Allow configuring trusted origins

This commit is contained in:
Gabriel Augendre 2022-11-10 20:45:44 +01:00
parent 14f0122639
commit 1c7d59c20e

View file

@ -21,6 +21,7 @@ env = environ.Env(
REGISTRATION_OPEN=(bool, True), REGISTRATION_OPEN=(bool, True),
MAILGUN_API_KEY=(str, ""), MAILGUN_API_KEY=(str, ""),
MAILGUN_SENDER_DOMAIN=(str, ""), MAILGUN_SENDER_DOMAIN=(str, ""),
CSRF_TRUSTED_ORIGINS=(list, ["http://localhost:8000"]),
) )
env_file = os.getenv("ENV_FILE", None) env_file = os.getenv("ENV_FILE", None)
@ -47,6 +48,7 @@ if DEBUG:
INTERNAL_IPS.append(ip) INTERNAL_IPS.append(ip)
ALLOWED_HOSTS.append(ip) ALLOWED_HOSTS.append(ip)
CSRF_TRUSTED_ORIGINS = env("CSRF_TRUSTED_ORIGINS")
# Application definition # Application definition