@@ -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
@@ -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
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 | 27 +++++++++++++++++++++++++-- patchwork/settings/dev.py | 5 ++++- 2 files changed, 29 insertions(+), 3 deletions(-)