From b1b47afddb53b2738c1f8cda005bf9d58be0d00b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Mon, 1 Jan 2018 12:03:56 +0100 Subject: [PATCH 2/4] general: update settings for Django 1.11 (#20933) --- hobo/settings.py | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/hobo/settings.py b/hobo/settings.py index be3dbdc..04507f3 100644 --- a/hobo/settings.py +++ b/hobo/settings.py @@ -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'), -- 2.15.1