diff mbox

[v5,3/8] settings: Resolve all but one Django 1.7 warning

Message ID BLU437-SMTP63EB05F93DD8BFE55F7B9BA3FD0@phx.gbl
State Accepted
Headers show

Commit Message

Stephen Finucane April 7, 2015, 9:20 p.m. UTC
From: Stephen Finucane <stephen.finucane@intel.com>

Resolve remaining Django 1.7 warnings with the exception of a single
deprecation warning. However, this remaining issue is really a
non-issue due to the limited (and non-offending) use of the code.

Signed-off-by: Stephen Finucane <stephenfinucane@hotmail.com>
---
 apps/settings.py | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/apps/settings.py b/apps/settings.py
index 379fbc5..9dbac19 100644
--- a/apps/settings.py
+++ b/apps/settings.py
@@ -1,5 +1,6 @@ 
 # Django settings for patchwork project.
 import os
+import django
 
 DEBUG = True
 TEMPLATE_DEBUG = DEBUG
@@ -51,17 +52,23 @@  SECRET_KEY = '00000000000000000000000000000000000000000000000000'
 TEMPLATE_LOADERS = (
     'django.template.loaders.filesystem.Loader',
     'django.template.loaders.app_directories.Loader',
-#     'django.template.loaders.eggs.load_template_source',
 )
 
-MIDDLEWARE_CLASSES = (
+MIDDLEWARE_CLASSES = [
     'django.middleware.common.CommonMiddleware',
     'django.contrib.sessions.middleware.SessionMiddleware',
     'django.contrib.auth.middleware.AuthenticationMiddleware',
     'django.contrib.messages.middleware.MessageMiddleware',
     'django.middleware.doc.XViewMiddleware',
     'django.middleware.csrf.CsrfViewMiddleware',
-)
+]
+
+if django.VERSION < (1, 7):
+    MIDDLEWARE_CLASSES.append('django.middleware.doc.XViewMiddleware')
+else:
+    MIDDLEWARE_CLASSES.append(
+        'django.contrib.admindocs.middleware.XViewMiddleware')
+    TEST_RUNNER = 'django.test.runner.DiscoverRunner'
 
 ROOT_URLCONF = 'urls'