Use settings.MIDDLEWARE for Django > 1.10
import os
import oscar
+from django import VERSION as DJANGO_VERSION
from oscar.defaults import * # noqa
@@ -68,15 +69,29 @@ TEMPLATES = [
]
-MIDDLEWARE_CLASSES = (
+if DJANGO_VERSION < (1, 10):
+ MIDDLEWARE_CLASSES = [
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
+
'oscar.apps.basket.middleware.BasketMiddleware',
-)
+ ]
+else:
+ MIDDLEWARE = [
+ 'django.middleware.common.CommonMiddleware',
+ 'django.contrib.sessions.middleware.SessionMiddleware',
+ 'django.middleware.csrf.CsrfViewMiddleware',
+ 'django.contrib.auth.middleware.AuthenticationMiddleware',
+ 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
+ 'django.contrib.messages.middleware.MessageMiddleware',
+
+ 'oscar.apps.basket.middleware.BasketMiddleware',
+ ]
+
AUTHENTICATION_BACKENDS = (
'oscar.apps.customer.auth_backends.EmailBackend',
