- Python (2.7, 3.4 - 3.6)
-- Django (1.8 - 1.11)
+- Django (1.11 - 2.0)
-- Django REST Framework (3.4 - 3.8)
+- Django REST Framework (3.6 - 3.8)
- Django Filters (1.0 - 1.1)
),
]
- if django.VERSION >= (1, 10):
- operations += [
- migrations.AlterModelOptions(
- name='patch',
- options={'base_manager_name': 'objects', 'verbose_name_plural': 'Patches'},
- ),
- ]
+ operations += [
+ migrations.AlterModelOptions(
+ name='patch',
+ options={'base_manager_name': 'objects', 'verbose_name_plural': 'Patches'},
+ ),
+ ]
import random
import re
-import django
from django.conf import settings
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
class PatchManager(models.Manager):
- use_for_related_fields = True
- # NOTE(stephenfin): This is necessary to silence a warning with Django >=
- # 1.10. Remove when 1.10 is the minimum supported version.
- silence_use_for_related_fields_deprecation = True
def get_queryset(self):
return PatchQuerySet(self.model, using=self.db)
class Meta:
verbose_name_plural = 'Patches'
- if django.VERSION >= (1, 10):
- base_manager_name = 'objects'
+ base_manager_name = 'objects'
class Comment(EmailMixin, models.Model):
import os
-import django
-
ROOT_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)),
os.pardir, os.pardir)
#
# Core settings
-# https://docs.djangoproject.com/en/1.8/ref/settings/#core-settings
+# https://docs.djangoproject.com/en/1.11/ref/settings/#core-settings
#
INSTALLED_APPS = [
'patchwork',
]
-_MIDDLEWARE_CLASSES = [
+MIDDLEWARE = [
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
]
-if django.VERSION >= (1, 10):
- MIDDLEWARE = _MIDDLEWARE_CLASSES
-else:
- MIDDLEWARE_CLASSES = _MIDDLEWARE_CLASSES
-
TIME_ZONE = 'Australia/Canberra'
LANGUAGE_CODE = 'en-au'
#
# Auth settings
-# https://docs.djangoproject.com/en/1.8/ref/settings/#auth
+# https://docs.djangoproject.com/en/1.11/ref/settings/#auth
#
LOGIN_URL = 'auth_login'
#
# Sites settings
-# https://docs.djangoproject.com/en/1.8/ref/settings/#sites
+# https://docs.djangoproject.com/en/1.11/ref/settings/#sites
#
SITE_ID = 1
#
# Static files settings
-# https://docs.djangoproject.com/en/1.8/ref/settings/#static-files
+# https://docs.djangoproject.com/en/1.11/ref/settings/#static-files
#
STATIC_URL = '/static/'
from __future__ import absolute_import
-import django
-
from .base import * # noqa
#
# Core settings
-# https://docs.djangoproject.com/en/1.8/ref/settings/#core-settings
+# https://docs.djangoproject.com/en/1.11/ref/settings/#core-settings
#
#
# Auth settings
-# https://docs.djangoproject.com/en/1.8/ref/settings/#auth
+# https://docs.djangoproject.com/en/1.11/ref/settings/#auth
#
# Use a faster, though less secure, password hasher for faster tests
-# https://docs.djangoproject.com/es/1.9/topics/testing/overview/#password-hashing
+# https://docs.djangoproject.com/es/1.11/topics/testing/overview/#password-hashing
PASSWORD_HASHERS = ['django.contrib.auth.hashers.MD5PasswordHasher']
#
DEBUG_TOOLBAR_PATCH_SETTINGS = False
# This should go first in the middleware classes
-if django.VERSION >= (1, 10):
- MIDDLEWARE = [
- 'debug_toolbar.middleware.DebugToolbarMiddleware',
- ] + MIDDLEWARE
-else:
- MIDDLEWARE_CLASSES = [
- 'debug_toolbar.middleware.DebugToolbarMiddleware',
- ] + MIDDLEWARE_CLASSES
+MIDDLEWARE = [
+ 'debug_toolbar.middleware.DebugToolbarMiddleware',
+] + MIDDLEWARE
INTERNAL_IPS = [
'127.0.0.1', '::1',
#
# Core settings
-# https://docs.djangoproject.com/en/1.8/ref/settings/#core-settings
+# https://docs.djangoproject.com/en/1.11/ref/settings/#core-settings
#
# Security
#
# If you're using a postgres database, connecting over a local unix-domain
# socket, then the following setting should work for you. Otherwise,
-# see https://docs.djangoproject.com/en/1.8/ref/settings/#databases
+# see https://docs.djangoproject.com/en/1.11/ref/settings/#databases
DATABASES = {
'default': {
#
# Static files settings
-# https://docs.djangoproject.com/en/1.8/ref/settings/#static-files
-# https://docs.djangoproject.com/en/1.8/ref/contrib/staticfiles/#manifeststaticfilesstorage
+# https://docs.djangoproject.com/en/1.11/ref/settings/#static-files
+# https://docs.djangoproject.com/en/1.11/ref/contrib/staticfiles/#manifeststaticfilesstorage
#
STATIC_ROOT = os.environ.get('STATIC_ROOT', '/srv/patchwork/htdocs/static')
-Django>=1.8,<2.0
+Django>=1.11,<2.0
djangorestframework>=3.4,<3.9
django-filter>=1.0,<1.2
-r requirements-test.txt
-Django>=1.8,<2.0
+Django>=1.11,<2.0
djangorestframework>=3.4,<3.9
django-filter>=1.0,<1.2
psycopg2>=2.7,<2.8
[tox]
minversion = 2.0
-envlist = pep8,docs,py{27,34,35}-django{18,19,110,111},py36-django111
+envlist = pep8,docs,py{27,34,35,36}-django111
skipsdist = True
[testenv]
deps =
-r{toxinidir}/requirements-test.txt
- django18: django>=1.8,<1.9
- django19: django>=1.9,<1.10
- django110: django>=1.10,<1.11
django111: django>=1.11,<2.0
- django{18,19}: djangorestframework>=3.4,<3.7
- django110: djangorestframework>=3.4,<3.9
django111: djangorestframework>=3.6,<3.9
- django18: django-filter>=1.0,<1.1
- django{19,110,111}: django-filter>=1.0,<1.2
+ django111: django-filter>=1.0,<1.2
setenv =
DJANGO_SETTINGS_MODULE = patchwork.settings.dev
PYTHONDONTWRITEBYTECODE = 1