MIDDLEWARE_CLASSES is deprecated in Django 1.11

I assumed the default middlewares (the ones generated by django-admin
startproject) were fine.
This commit is contained in:
Martin Pépin 2019-10-04 23:35:36 +02:00
parent 318b1dda78
commit 1fa96b8677
No known key found for this signature in database
GPG key ID: E7520278B1774448
2 changed files with 4 additions and 7 deletions

View file

@ -53,16 +53,15 @@ INSTALLED_APPS = [
'avisstage' 'avisstage'
] ]
MIDDLEWARE_CLASSES = ( MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware',
'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',
) ]
TEMPLATES = [ TEMPLATES = [
{ {

View file

@ -16,9 +16,7 @@ if USE_DEBUG_TOOLBAR:
'debug_toolbar', 'debug_toolbar',
] ]
MIDDLEWARE_CLASSES = ( MIDDLEWARE += ['debug_toolbar.middleware.DebugToolbarMiddleware']
'debug_toolbar.middleware.DebugToolbarMiddleware',
) + MIDDLEWARE_CLASSES
INTERNAL_IPS = ['127.0.0.1'] INTERNAL_IPS = ['127.0.0.1']