From 8f7f255580a4e54b72a450a42d2fdabe48dd591a Mon Sep 17 00:00:00 2001 From: Diederik van der Boor Date: Sat, 30 Sep 2017 16:33:52 +0200 Subject: [PATCH] Fixed template settings in example app (cherry picked from commit 19497960c7ac4a082ea5e89024433d3254db8182) --- example/example/settings.py | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/example/example/settings.py b/example/example/settings.py index abb389b..1514227 100644 --- a/example/example/settings.py +++ b/example/example/settings.py @@ -1,7 +1,6 @@ import os DEBUG = True -TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), @@ -42,11 +41,6 @@ STATICFILES_FINDERS = ( 'django.contrib.staticfiles.finders.AppDirectoriesFinder', ) -TEMPLATE_LOADERS = ( - 'django.template.loaders.filesystem.Loader', - 'django.template.loaders.app_directories.Loader', -) - MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', @@ -55,12 +49,30 @@ MIDDLEWARE_CLASSES = ( 'django.contrib.messages.middleware.MessageMiddleware', ) +TEMPLATES=[{ + "BACKEND": "django.template.backends.django.DjangoTemplates", + "DIRS": (), + "OPTIONS": { + "loaders": ( + "django.template.loaders.filesystem.Loader", + "django.template.loaders.app_directories.Loader", + ), + "context_processors": ( + "django.template.context_processors.debug", + "django.template.context_processors.i18n", + "django.template.context_processors.media", + "django.template.context_processors.request", + "django.template.context_processors.static", + "django.contrib.messages.context_processors.messages", + "django.contrib.auth.context_processors.auth", + ), + }, +}] + ROOT_URLCONF = 'example.urls' WSGI_APPLICATION = 'example.wsgi.application' -TEMPLATE_DIRS = () - INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.admin',