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 | 367f64864ccca1b1062d8dbe9333db2a2d8c0a84 (patch) | |
| tree | e55a398b0f44d7d49d3ef275019e4c655b368c11 /example_project/settings.py | |
| parent | a6aa949e1e74c9edd81b275d61e1f354b5c39ba5 (diff) | |
| download | Ishtar-367f64864ccca1b1062d8dbe9333db2a2d8c0a84.tar.bz2 Ishtar-367f64864ccca1b1062d8dbe9333db2a2d8c0a84.zip | |
Django 1.11: settings new TEMPLATE configuration
Diffstat (limited to 'example_project/settings.py')
| -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', | 
