From: Stephen Finucane Date: Tue, 8 Dec 2015 15:37:52 +0000 (+0000) Subject: settings: Add TEMPLATES setting X-Git-Tag: v1.1.0~65 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=da0839d85c572aaec57ec41d541282d782657cc2;p=thirdparty%2Fpatchwork.git settings: Add TEMPLATES setting 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 --- diff --git a/patchwork/settings/base.py b/patchwork/settings/base.py index ae936223..5f51e476 100644 --- a/patchwork/settings/base.py +++ b/patchwork/settings/base.py @@ -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 diff --git a/patchwork/settings/dev.py b/patchwork/settings/dev.py index 3ecdb066..20626c63 100644 --- a/patchwork/settings/dev.py +++ b/patchwork/settings/dev.py @@ -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