general: update settings for Django 1.11 (#20933)

This commit is contained in:
Frédéric Péters 2018-01-01 12:03:56 +01:00
parent 5a15dd034a
commit 2bb09b4c70
1 changed files with 25 additions and 12 deletions

View File

@ -24,8 +24,6 @@ SECRET_KEY = 'hc^g)m7+*n+!8ej5i4*5iiv21s-y#+lpgje1w8d1jw5cyd+g%s'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
TEMPLATE_DEBUG = True
ALLOWED_HOSTS = []
@ -59,11 +57,30 @@ MIDDLEWARE_CLASSES = (
'hobo.middleware.utils.StoreRequestMiddleware',
)
TEMPLATE_CONTEXT_PROCESSORS = (
'django.core.context_processors.request',
'hobo.context_processors.template_vars',
'hobo.context_processors.hobo_json',
) + global_settings.TEMPLATE_CONTEXT_PROCESSORS
# Templates
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [
os.path.join(BASE_DIR, 'hobo', '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',
'hobo.context_processors.template_vars',
'hobo.context_processors.hobo_json',
],
},
},
]
ROOT_URLCONF = 'hobo.urls'
@ -100,11 +117,7 @@ USE_TZ = True
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
TEMPLATE_DIRS = (
os.path.join(BASE_DIR, 'hobo', 'templates'),
)
STATICFILES_FINDERS = global_settings.STATICFILES_FINDERS + ('gadjo.finders.XStaticFinder',)
STATICFILES_FINDERS = list(global_settings.STATICFILES_FINDERS) + ['gadjo.finders.XStaticFinder']
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'hobo', 'static'),