From b27911ce42c2b19b38b4f139651eb862e6ce7124 Mon Sep 17 00:00:00 2001 From: "jeanloup.monnier" Date: Fri, 27 Jan 2023 10:24:56 +0100 Subject: [PATCH] ci: fix CSRF_TRUSTED_ORIGINS absent in ci --- controller/settings.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/controller/settings.py b/controller/settings.py index acdd3c4..2eb9775 100644 --- a/controller/settings.py +++ b/controller/settings.py @@ -32,10 +32,13 @@ STATIC_ROOT = os.path.join(BASE_DIR, "assets/static") MEDIA_ROOT = os.path.join(BASE_DIR, "assets/media") -if not DEBUG: - ALLOWED_HOSTS = os.getenv("ALLOWED_HOSTS", "").split(",") + +ALLOWED_HOSTS = os.getenv("ALLOWED_HOSTS", "").split(",") + +if os.getenv("CSRF_TRUSTED_ORIGINS", ""): CSRF_TRUSTED_ORIGINS = os.getenv("CSRF_TRUSTED_ORIGINS", "").split(",") -else: + +if DEBUG: ALLOWED_HOSTS = ["*"] # Application definition