From b17766cea840dcd00cae455f69fddda49f445737 Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Wed, 21 Feb 2018 18:33:45 +0100 Subject: [PATCH] Update template configuration syntax Change to syntax compatible with newer Django, still works on current version. --- pgcommitfest/settings.py | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/pgcommitfest/settings.py b/pgcommitfest/settings.py index c4c0e37..44106a7 100644 --- a/pgcommitfest/settings.py +++ b/pgcommitfest/settings.py @@ -87,13 +87,6 @@ STATICFILES_FINDERS = ( # Make this unique, and don't share it with anybody. SECRET_KEY = 'REALLYCHANGETHISINLOCAL_SETTINGS.PY' -# List of callables that know how to import templates from various sources. -TEMPLATE_LOADERS = ( - 'django.template.loaders.filesystem.Loader', - 'django.template.loaders.app_directories.Loader', -# 'django.template.loaders.eggs.Loader', -) - MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', @@ -104,17 +97,18 @@ MIDDLEWARE_CLASSES = ( ROOT_URLCONF = 'pgcommitfest.urls' -TEMPLATE_DIRS = ( - # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". - # Always use forward slashes, even on Windows. - # Don't forget to use absolute paths, not relative paths. - 'global_template/', -) - - -TEMPLATE_CONTEXT_PROCESSORS = global_settings.TEMPLATE_CONTEXT_PROCESSORS + ( - 'django.core.context_processors.request', -) +TEMPLATES = [{ + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': ['global_templates'], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + ], + }, +}] INSTALLED_APPS = ( 'django.contrib.auth', -- 2.39.5