From e02967957dc521135de7e66ec9fb82419351cf6e Mon Sep 17 00:00:00 2001 From: moanos Date: Mon, 25 Mar 2024 10:49:13 +0100 Subject: [PATCH] refactor: Abstract host --- src/notfellchen/settings.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/notfellchen/settings.py b/src/notfellchen/settings.py index c92b9a5..9a6ba0b 100644 --- a/src/notfellchen/settings.py +++ b/src/notfellchen/settings.py @@ -94,11 +94,11 @@ STATIC_ROOT = config.get("locations", "static", fallback="/notfellchen/static") MEDIA_ROOT = config.get("locations", "media", fallback="/notfellchen/static") MEDIA_URL = '/media/' +host = config.get("notfellchen", "host", fallback='*') # see https://docs.djangoproject.com/en/3.2/ref/settings/#std-setting-ALLOWED_HOSTS -ALLOWED_HOSTS = [config.get("notfellchen", "host", fallback='*')] -CSRF_TRUSTED_ORIGINS = [f"https://{config.get('notfellchen', 'host', fallback='')}"] -print(f"Allowed hosts: {ALLOWED_HOSTS}") +ALLOWED_HOSTS = [host] +CSRF_TRUSTED_ORIGINS = [f"https://{host}"] # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/3.2/howto/static-files/