Obtain value for MULTISITE_CMS_URLS from env

This commit is contained in:
PCoder 2018-02-20 06:25:02 +01:00
parent d5a0224476
commit c1d98603e6

View file

@ -514,18 +514,29 @@ STRIPE_API_PRIVATE_KEY_TEST = env('STRIPE_API_PRIVATE_KEY_TEST')
ANONYMOUS_USER_NAME = 'anonymous@ungleich.ch' ANONYMOUS_USER_NAME = 'anonymous@ungleich.ch'
GUARDIAN_GET_INIT_ANONYMOUS_USER = 'membership.models.get_anonymous_user_instance' GUARDIAN_GET_INIT_ANONYMOUS_USER = 'membership.models.get_anonymous_user_instance'
MULTISITE_CMS_URLS = { UNGLEICH_SITE_CONFIGS = env('UNGLEICH_SITE_CONFIGS')
'dynamicweb-development2.ungleich.ch': 'dynamicweb.urls',
'blog-dev2.ungleich.ch': 'dynamicweb.urls', MULTISITE_CMS_URLS = {}
'nuglarus-dev2.ungleich.ch': 'dynamicweb.urls_multi', if UNGLEICH_SITE_CONFIGS == "":
} raise Exception("Please define UNGLEICH_SITE_CONFIGS in your .env")
else:
ungleich_site_config_list = UNGLEICH_SITE_CONFIGS.split(";")
for ungliech_site_config in ungleich_site_config_list:
ungliech_site_params = ungliech_site_config.split(":")
if len(ungliech_site_params) <= 1:
raise Exception("Incomplete UNGLEICH_SITE_CONFIGS")
else:
MULTISITE_CMS_URLS[ungliech_site_params[0]] = ungliech_site_params[1]
MULTISITE_CMS_ALIASES = { MULTISITE_CMS_ALIASES = {
} }
MULTISITE_CMS_FALLBACK = 'blog-dev2.ungleich.ch' MULTISITE_CMS_FALLBACK = env('MULTISITE_CMS_FALLBACK')
if MULTISITE_CMS_FALLBACK == '':
MULTISITE_CMS_FALLBACK = 'datacenterlight.ch'
MULTISITE_FALLBACK = 'django.views.generic.base.RedirectView' MULTISITE_FALLBACK = 'django.views.generic.base.RedirectView'
MULTISITE_FALLBACK_KWARGS = {
MULTISITE_FALLBACK_KWARGS = {'url': 'https://datacenterlight.ch/', 'url': 'https://{}/'.format(MULTISITE_CMS_FALLBACK), 'permanent': False
'permanent': False} }
FILER_ENABLE_PERMISSIONS = True FILER_ENABLE_PERMISSIONS = True