diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-08-22 00:31:25 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-08-22 00:31:25 +0200 |
commit | 9314f621ef3989ebe6aa01c44fd501299fef8d53 (patch) | |
tree | e55a398b0f44d7d49d3ef275019e4c655b368c11 | |
parent | cca497f2b81fa6d7d7797953afda2bcffea8e066 (diff) | |
download | Ishtar-9314f621ef3989ebe6aa01c44fd501299fef8d53.tar.bz2 Ishtar-9314f621ef3989ebe6aa01c44fd501299fef8d53.zip |
Django 1.11: settings new TEMPLATE configuration
-rw-r--r-- | example_project/settings.py | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/example_project/settings.py b/example_project/settings.py index a104d4715..2d19cacc6 100644 --- a/example_project/settings.py +++ b/example_project/settings.py @@ -8,7 +8,6 @@ import sys DEBUG = False DEBUG_TOOLBAR = False DEBUG_TO_CONSOLE = False -TEMPLATE_DEBUG = DEBUG SQL_DEBUG = False DJANGO_EXTENSIONS = False USE_SPATIALITE_FOR_TESTS = False @@ -98,13 +97,6 @@ MEDIA_ROOT = ROOT_PATH + 'media/' # Examples: "http://media.lawrence.com", "http://example.com/media/" MEDIA_URL = '/media/' -# 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', @@ -114,21 +106,29 @@ MIDDLEWARE_CLASSES = [ 'django.middleware.locale.LocaleMiddleware', ] -TEMPLATE_CONTEXT_PROCESSORS = ( - 'ishtar_common.context_processors.get_base_context', - "django.contrib.auth.context_processors.auth", - "django.core.context_processors.debug", - "django.core.context_processors.i18n", - "django.core.context_processors.media", - "django.core.context_processors.static", - "django.core.context_processors.request", -) +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [os.path.join(ROOT_PATH, 'templates')], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + "django.template.context_processors.debug", + "django.template.context_processors.request", + 'ishtar_common.context_processors.get_base_context', + "django.contrib.auth.context_processors.auth", + 'django.contrib.messages.context_processors.messages', + "django.template.context_processors.i18n", + "django.template.context_processors.media", + "django.template.context_processors.static", + "django.template.context_processors.csrf" + ], + }, + }, +] -ROOT_URLCONF = 'example_project.urls' -TEMPLATE_DIRS = ( - ROOT_PATH + 'templates', -) +ROOT_URLCONF = 'example_project.urls' AUTHENTICATION_BACKENDS = ( 'ishtar_common.backend.ObjectPermBackend', |