fix csrf check

This commit is contained in:
2023-10-29 23:35:41 +01:00
parent b29efdb503
commit e9749650f1
2 changed files with 3 additions and 1 deletions

View File

@@ -18,3 +18,4 @@ POSTGRES_DB=
DRF_SECRET_KEY=
DRF_DEBUG=
ALLOWED_HOSTS=
CSRF_TRUSTED_ORIGINS=

View File

@@ -28,7 +28,8 @@ DEBUG = os.getenv("DRF_DEBUG", False) == "True"
ALLOWED_HOSTS = os.environ.get("ALLOWED_HOSTS", "").split(",")
ALLOWED_HOSTS = [] if not any(ALLOWED_HOSTS) else ALLOWED_HOSTS
CSRF_TRUSTED_ORIGINS = ALLOWED_HOSTS
CSRF_TRUSTED_ORIGINS = os.environ.get("CSRF_TRUSTED_ORIGINS", "").split(",")
CSRF_TRUSTED_ORIGINS = [] if not any(CSRF_TRUSTED_ORIGINS) else CSRF_TRUSTED_ORIGINS
# Application definition