From cad3b5b96700e7904dd1f1f3956ff97e9ddeca5a Mon Sep 17 00:00:00 2001 From: Tai Lee Date: Sat, 14 Nov 2020 02:59:42 +1100 Subject: [PATCH] Fix `XViewMiddleware` name in Django <1.8. --- ixc_django_docker/settings/base.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/ixc_django_docker/settings/base.py b/ixc_django_docker/settings/base.py index f14351d..a24a076 100644 --- a/ixc_django_docker/settings/base.py +++ b/ixc_django_docker/settings/base.py @@ -270,13 +270,15 @@ 'django.middleware.clickjacking.XFrameOptionsMiddleware', ) -if django.VERSION < (1, 10): +if django.VERSION >= (1, 8): MIDDLEWARE += ('django.contrib.admindocs.middleware.XViewMiddleware', ) +else: + MIDDLEWARE += ('django.middleware.doc.XViewMiddleware', ) - if django.VERSION >= (1, 7): - MIDDLEWARE += ( - 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', - ) +if (1, 7) <= django.VERSION < (1, 10): + MIDDLEWARE += ( + 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', + ) ROOT_URLCONF = 'ixc_django_docker.urls'