From 0c1411a93a8c3619065fd9f161df69b1887ff0ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Wed, 26 Apr 2017 18:29:30 +0200 Subject: [PATCH 2/3] misc: update to use new TEMPLATES settings (#16056) --- fargo/settings.py | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/fargo/settings.py b/fargo/settings.py index 12d31fc..5336bad 100644 --- a/fargo/settings.py +++ b/fargo/settings.py @@ -8,7 +8,7 @@ https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ -from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS, STATICFILES_FINDERS +from django.conf.global_settings import STATICFILES_FINDERS # Build paths inside the project like this: os.path.join(BASE_DIR, ...) import os @@ -24,8 +24,6 @@ SECRET_KEY = '74lgky$@g*rv=@1o55b-^ct&)))+xf+r3*vqmy#bg6!89*-*ym' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True -TEMPLATE_DEBUG = True - ALLOWED_HOSTS = [] @@ -54,9 +52,29 @@ MIDDLEWARE_CLASSES = ( 'django.middleware.clickjacking.XFrameOptionsMiddleware', ) -TEMPLATE_CONTEXT_PROCESSORS += ( - 'django.core.context_processors.request', -) +# Templates +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [ + os.path.join(BASE_DIR, 'fargo', '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.request', + 'django.template.context_processors.static', + 'django.template.context_processors.tz', + 'django.contrib.messages.context_processors.messages', + ], + }, + }, +] + ROOT_URLCONF = 'fargo.urls' @@ -90,8 +108,6 @@ USE_TZ = True STATICFILES_DIRS = [os.path.join(BASE_DIR, 'fargo', 'static')] -TEMPLATE_DIRS = [os.path.join(BASE_DIR, 'fargo', 'templates')] - MEDIA_ROOT = os.path.join(BASE_DIR, 'media') LOCALE_PATHS = [os.path.join(BASE_DIR, 'fargo', 'locale')] -- 2.11.0