From a283cc944c75b4df3d34ba12fbfa3ef7f6b19a1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Tue, 2 Jan 2018 17:37:17 +0100 Subject: [PATCH] debian: move "stable" settings to debian_config.py (#20955) --- debian/debian_config.py | 25 +++++++++++++++++++++++++ debian/settings.py | 24 ------------------------ 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/debian/debian_config.py b/debian/debian_config.py index 4ced906f..f0ac5af4 100644 --- a/debian/debian_config.py +++ b/debian/debian_config.py @@ -9,6 +9,31 @@ PROJECT_NAME = 'wcs' # execfile('/usr/lib/hobo/debian_config_common.py') +# and some hobo parts that are specific to w.c.s. +TEMPLATES[0]['OPTIONS']['context_processors'] = [ + 'hobo.context_processors.template_vars', + 'hobo.context_processors.theme_base', + ] + TEMPLATES[0]['OPTIONS']['context_processors'] + +if not 'MIDDLEWARE_CLASSES' in globals(): + MIDDLEWARE_CLASSES = global_settings.MIDDLEWARE_CLASSES + +MIDDLEWARE_CLASSES = ( + 'hobo.middleware.utils.StoreRequestMiddleware', + 'hobo.middleware.xforwardedfor.XForwardedForMiddleware', + 'hobo.middleware.VersionMiddleware', # /__version__ + 'hobo.middleware.cors.CORSMiddleware', +) + MIDDLEWARE_CLASSES + +CACHES = { + 'default': { + 'BACKEND': 'wcs.cache.WcsTenantCache', + # add a real Django cache backend, with its parameters if needed + 'REAL_BACKEND': 'django.core.cache.backends.memcached.MemcachedCache', + 'LOCATION': '127.0.0.1:11211', + } +} + # # local settings # diff --git a/debian/settings.py b/debian/settings.py index 3d812b31..c5ae9faf 100644 --- a/debian/settings.py +++ b/debian/settings.py @@ -13,7 +13,6 @@ # SECURITY WARNING: don't run with debug turned on in production! DEBUG = False -TEMPLATE_DEBUG = False #ADMINS = ( # # ('User 1', 'watchdog@example.net'), @@ -54,28 +53,5 @@ TIME_ZONE = 'Europe/Paris' # CSRF_COOKIE_SECURE = True # SESSION_COOKIE_SECURE = True -TEMPLATE_CONTEXT_PROCESSORS = ('django.core.context_processors.request', - 'hobo.context_processors.template_vars', - 'hobo.context_processors.theme_base') + TEMPLATE_CONTEXT_PROCESSORS - -if not 'MIDDLEWARE_CLASSES' in globals(): - MIDDLEWARE_CLASSES = global_settings.MIDDLEWARE_CLASSES - -MIDDLEWARE_CLASSES = ( - 'hobo.middleware.utils.StoreRequestMiddleware', - 'hobo.middleware.xforwardedfor.XForwardedForMiddleware', - 'hobo.middleware.VersionMiddleware', # /__version__ - 'hobo.middleware.cors.CORSMiddleware', -) + MIDDLEWARE_CLASSES - -CACHES = { - 'default': { - 'BACKEND': 'wcs.cache.WcsTenantCache', - # add a real Django cache backend, with its parameters if needed - 'REAL_BACKEND': 'django.core.cache.backends.memcached.MemcachedCache', - 'LOCATION': '127.0.0.1:11211', - } -} - WCS_LEGACY_CONFIG_FILE = '/etc/wcs/wcs.cfg' WCS_EXTRA_MODULES = [] -- 2.15.1