From 1c7d59c20ed6909b02d55200466b0f5f9483a21f Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Thu, 10 Nov 2022 20:45:44 +0100 Subject: [PATCH] Allow configuring trusted origins --- src/charasheet/settings.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/charasheet/settings.py b/src/charasheet/settings.py index 4b42c4e..992fc46 100644 --- a/src/charasheet/settings.py +++ b/src/charasheet/settings.py @@ -21,6 +21,7 @@ env = environ.Env( REGISTRATION_OPEN=(bool, True), MAILGUN_API_KEY=(str, ""), MAILGUN_SENDER_DOMAIN=(str, ""), + CSRF_TRUSTED_ORIGINS=(list, ["http://localhost:8000"]), ) env_file = os.getenv("ENV_FILE", None) @@ -47,6 +48,7 @@ if DEBUG: INTERNAL_IPS.append(ip) ALLOWED_HOSTS.append(ip) +CSRF_TRUSTED_ORIGINS = env("CSRF_TRUSTED_ORIGINS") # Application definition