Update Django 2.0

This commit is contained in:
Aarni Halinen
2018-05-09 20:03:30 +03:00
parent e25041d38d
commit 48b6ed5b69
3 changed files with 13 additions and 8 deletions
+4 -4
View File
@@ -1,6 +1,6 @@
backports.shutil-get-terminal-size==1.0.0 backports.shutil-get-terminal-size==1.0.0
decorator==4.0.9 decorator==4.0.9
Django==1.11 Django==2.0
ipython==4.2.0 ipython==4.2.0
ipython-genutils==0.1.0 ipython-genutils==0.1.0
pexpect==4.1.0 pexpect==4.1.0
@@ -13,7 +13,7 @@ Pillow==4.3.0
requests==2.11.1 requests==2.11.1
django-nocaptcha-recaptcha==0.0.19 django-nocaptcha-recaptcha==0.0.19
django-cors-headers==2.0.1 django-cors-headers==2.0.1
djangorestframework==3.5.3 djangorestframework==3.8.2
coverage==4.3.4 coverage==4.3.4
django-nose==1.4.5 django-nose==1.4.5
nose-exclude==0.5.0 nose-exclude==0.5.0
@@ -22,14 +22,14 @@ django-bootstrap3==8.2.3
django-tables2==1.6.1 django-tables2==1.6.1
pycodestyle==2.3.1 pycodestyle==2.3.1
dealer==2.0.5 dealer==2.0.5
django-modeltranslation==0.12.1 django-modeltranslation==0.13b1
django-auditlog==0.4.5 django-auditlog==0.4.5
django-phonenumber-field==1.3.0 django-phonenumber-field==1.3.0
django-autocomplete-light==3.2.10 django-autocomplete-light==3.2.10
six==1.10.0 six==1.10.0
django-suit==0.2.26 django-suit==0.2.26
telepot==12.3 telepot==12.3
django-password-reset==1.0 django-password-reset==1.0.1
pyexcel==0.5.7 pyexcel==0.5.7
pyexcel-xlsx==0.5.5 pyexcel-xlsx==0.5.5
django-import-export==0.7.0 django-import-export==0.7.0
+4 -2
View File
@@ -118,7 +118,7 @@ NOSE_ARGS = [
'--exclude-dir={}'.format(os.path.join(BASE_DIR, 'webapp', 'migrations')), '--exclude-dir={}'.format(os.path.join(BASE_DIR, 'webapp', 'migrations')),
] ]
MIDDLEWARE_CLASSES = [ MIDDLEWARE = [
'sikweb.middleware.ForceDefaultLanguageMiddleware', 'sikweb.middleware.ForceDefaultLanguageMiddleware',
'django.middleware.security.SecurityMiddleware', 'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware',
@@ -127,11 +127,13 @@ MIDDLEWARE_CLASSES = [
'django.middleware.common.CommonMiddleware', 'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware', 'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware', 'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware',
'auditlog.middleware.AuditlogMiddleware' 'auditlog.middleware.AuditlogMiddleware'
] ]
MIDDLEWARE_CLASSES = [
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
]
CORS_ORIGIN_ALLOW_ALL = True CORS_ORIGIN_ALLOW_ALL = True
ROOT_URLCONF = 'sikweb.urls' ROOT_URLCONF = 'sikweb.urls'
+5 -2
View File
@@ -1,4 +1,4 @@
class ForceDefaultLanguageMiddleware(object): def ForceDefaultLanguageMiddleware(get_response):
""" """
Ignore Accept-Language HTTP headers Ignore Accept-Language HTTP headers
@@ -8,6 +8,9 @@ class ForceDefaultLanguageMiddleware(object):
Should be installed *before* any middleware that checks request.META['HTTP_ACCEPT_LANGUAGE'], Should be installed *before* any middleware that checks request.META['HTTP_ACCEPT_LANGUAGE'],
namely django.middleware.locale.LocaleMiddleware namely django.middleware.locale.LocaleMiddleware
""" """
def process_request(self, request): def process_request(request):
if 'HTTP_ACCEPT_LANGUAGE' in request.META: if 'HTTP_ACCEPT_LANGUAGE' in request.META:
del request.META['HTTP_ACCEPT_LANGUAGE'] del request.META['HTTP_ACCEPT_LANGUAGE']
return get_response(request)
return process_request