misc: update to use new TEMPLATES settings (#16056)

This commit is contained in:
Frédéric Péters 2017-04-26 18:29:30 +02:00
parent 8cd7cabb00
commit 7ed396892d
1 changed files with 24 additions and 8 deletions

View File

@ -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 = []
@ -55,9 +53,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'
@ -91,8 +109,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')]