From 1fa96b867738fd35a1cf1f3753496053a410710b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20P=C3=A9pin?= Date: Fri, 4 Oct 2019 23:35:36 +0200 Subject: [PATCH] MIDDLEWARE_CLASSES is deprecated in Django 1.11 I assumed the default middlewares (the ones generated by django-admin startproject) were fine. --- experiENS/settings_base.py | 7 +++---- experiENS/settings_dev.py | 4 +--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/experiENS/settings_base.py b/experiENS/settings_base.py index 8e7f517..d2fa5a5 100644 --- a/experiENS/settings_base.py +++ b/experiENS/settings_base.py @@ -53,16 +53,15 @@ INSTALLED_APPS = [ 'avisstage' ] -MIDDLEWARE_CLASSES = ( +MIDDLEWARE = [ + 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', - 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', -) - +] TEMPLATES = [ { diff --git a/experiENS/settings_dev.py b/experiENS/settings_dev.py index 295def3..ed1c48a 100644 --- a/experiENS/settings_dev.py +++ b/experiENS/settings_dev.py @@ -16,9 +16,7 @@ if USE_DEBUG_TOOLBAR: 'debug_toolbar', ] - MIDDLEWARE_CLASSES = ( - 'debug_toolbar.middleware.DebugToolbarMiddleware', - ) + MIDDLEWARE_CLASSES + MIDDLEWARE += ['debug_toolbar.middleware.DebugToolbarMiddleware'] INTERNAL_IPS = ['127.0.0.1']