Update template configuration syntax
authorMagnus Hagander <[email protected]>
Wed, 21 Feb 2018 17:33:45 +0000 (18:33 +0100)
committerMagnus Hagander <[email protected]>
Wed, 21 Feb 2018 17:35:53 +0000 (18:35 +0100)
Change to syntax compatible with newer Django, still works on current
version.

pgcommitfest/settings.py

index c4c0e37e1722cdefdcd4b4a0952142e7f90d33ba..44106a789cd23978bcfaebcac48dce2f954372a2 100644 (file)
@@ -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',