]> git.ozlabs.org Git - patchwork/commitdiff
settings: Resolve all but one Django 1.7 warning
authorStephen Finucane <stephen.finucane@intel.com>
Tue, 7 Apr 2015 21:20:50 +0000 (22:20 +0100)
committerJeremy Kerr <jk@ozlabs.org>
Sun, 3 May 2015 05:46:52 +0000 (13:46 +0800)
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>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
apps/settings.py

index 379fbc5128771a43e6a5ac17adf477604ce9c977..9dbac19d6d686cdbdc34f8297526569c69a2ce75 100644 (file)
@@ -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'