]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
settings: Add TEMPLATES setting
authorStephen Finucane <stephen.finucane@intel.com>
Tue, 8 Dec 2015 15:37:52 +0000 (15:37 +0000)
committerStephen Finucane <stephen.finucane@intel.com>
Tue, 19 Jan 2016 21:55:27 +0000 (21:55 +0000)
This was added in Django 1.8 and will be required by Django 1.10.

https://docs.djangoproject.com/en/1.9/ref/templates/upgrading/#the-templates-settings

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
patchwork/settings/base.py
patchwork/settings/dev.py

index ae9362234b508fdcf65550cd429082bb45adbc2e..5f51e4761c0722d781f1c0e7e4ccd7adf6e64735 100644 (file)
@@ -61,9 +61,32 @@ ROOT_URLCONF = 'patchwork.urls'
 
 # Templates
 
-TEMPLATE_DIRS = (
+_TEMPLATE_DIRS = [
     os.path.join(ROOT_DIR, 'templates'),
-)
+]
+
+if django.VERSION >= (1, 8):
+    TEMPLATES = [
+        {
+            'BACKEND': 'django.template.backends.django.DjangoTemplates',
+            'DIRS': _TEMPLATE_DIRS,
+            'APP_DIRS': True,
+            'OPTIONS': {
+                'context_processors': [
+                    'django.contrib.auth.context_processors.auth',
+                    'django.template.context_processors.debug',
+                    'django.template.context_processors.i18n',
+                    'django.template.context_processors.media',
+                    'django.template.context_processors.static',
+                    'django.template.context_processors.tz',
+                    'django.contrib.messages.context_processors.messages',
+                ],
+            },
+        },
+    ]
+else:
+    TEMPLATE_DIRS = _TEMPLATE_DIRS
+
 
 # Email
 
index 3ecdb066c96daaa9e408a62e6a5e4e573185f7ce..20626c63af5d660e159fea6de290b74dd1e3c7ba 100644 (file)
@@ -28,7 +28,10 @@ DEBUG = True
 
 # Templates
 
-TEMPLATE_DEBUG = True
+if django.VERSION < (1, 8):
+    # In Django 1.8+, this is only necessary if the value differs from
+    # the value for 'DEBUG'
+    TEMPLATE_DEBUG = True
 
 # Database