Use new TEMPLATES setting

Django 1.8 introduced this as a soft requirement, it is a hard
requirement for later Django releases.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
This commit is contained in:
Paul Eggleton 2018-04-12 15:16:44 +12:00
parent 36e9f18ecd
commit 64b4a3daef

View File

@ -4,7 +4,6 @@
# Copyright (c) Django Software Foundation and individual contributors. # Copyright (c) Django Software Foundation and individual contributors.
DEBUG = False DEBUG = False
TEMPLATE_DEBUG = DEBUG
ADMINS = ( ADMINS = (
# ('Your Name', 'your_email@example.com'), # ('Your Name', 'your_email@example.com'),
@ -92,13 +91,6 @@ STATICFILES_FINDERS = (
# Make this unique, and don't share it with anybody. # Make this unique, and don't share it with anybody.
SECRET_KEY = '' SECRET_KEY = ''
# 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 = ( MIDDLEWARE_CLASSES = (
'corsheaders.middleware.CorsMiddleware', 'corsheaders.middleware.CorsMiddleware',
'django.middleware.common.CommonMiddleware', 'django.middleware.common.CommonMiddleware',
@ -119,20 +111,30 @@ CORS_URLS_REGEX = r'.*/api/.*';
# Clickjacking protection # Clickjacking protection
X_FRAME_OPTIONS = 'DENY' X_FRAME_OPTIONS = 'DENY'
from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS as TCP
TEMPLATE_CONTEXT_PROCESSORS = TCP + (
'django.template.context_processors.request',
'layerindex.context_processors.layerindex_context',
)
ROOT_URLCONF = 'urls' ROOT_URLCONF = 'urls'
TEMPLATE_DIRS = ( TEMPLATES = [
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". {
# Always use forward slashes, even on Windows. 'BACKEND': 'django.template.backends.django.DjangoTemplates',
# Don't forget to use absolute paths, not relative paths. 'DIRS': [
BASE_DIR + "/templates", BASE_DIR + "/templates",
) ],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.contrib.auth.context_processors.auth',
'django.template.context_processors.debug',
'django.template.context_processors.i18n',
'django.template.context_processors.media',
'django.template.context_processors.static',
'django.template.context_processors.tz',
'django.contrib.messages.context_processors.messages',
'django.template.context_processors.request',
'layerindex.context_processors.layerindex_context',
],
},
},
]
INSTALLED_APPS = ( INSTALLED_APPS = (
'django.contrib.auth', 'django.contrib.auth',