From 6142b72c807d594f784185157530b9dd537bf166 Mon Sep 17 00:00:00 2001 From: Joep de Jong Date: Mon, 12 Aug 2024 17:45:49 +0000 Subject: [PATCH] Black --- ci.env | 1 + dev.env | 1 + dienst2/settings.py | 3 +++ 3 files changed, 5 insertions(+) diff --git a/ci.env b/ci.env index 4d5a677..43b63c5 100644 --- a/ci.env +++ b/ci.env @@ -4,3 +4,4 @@ DATABASE_URL=postgres://postgres@127.0.0.1/dienst2?atomic_requests=True CACHE_URL=dummycache:// GOOGLE_SERVICE_ACCOUNT_DELEGATED_USER="joepj@ch.tudelft.nl" GOOGLE_IAP_AUDIENCE= +CSRF_TRUSTED_ORIGINS=http://localhost:8000 diff --git a/dev.env b/dev.env index c185664..1f75621 100644 --- a/dev.env +++ b/dev.env @@ -6,3 +6,4 @@ CACHE_URL=dummycache:// INTERNAL_IPS=127.0.0.1,172.18.0.1 GOOGLE_SERVICE_ACCOUNT_DELEGATED_USER="joepj@ch.tudelft.nl" GOOGLE_IAP_AUDIENCE=/projects/966138216790/apps/wisvch +CSRF_TRUSTED_ORIGINS=http://localhost:8000 diff --git a/dienst2/settings.py b/dienst2/settings.py index bed8a56..2abdf53 100644 --- a/dienst2/settings.py +++ b/dienst2/settings.py @@ -15,6 +15,9 @@ ALLOWED_HOSTS = env.list("ALLOWED_HOSTS", default=["*"]) INTERNAL_IPS = env.list("INTERNAL_IPS", default="") +CSRF_TRUSTED_ORIGINS = env.list( + "CSRF_TRUSTED_ORIGINS", default=["https://dienst2.ch.tudelft.nl"] +) SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https") DATABASES = {"default": env.db()}