Correct syntax of `CSRF_TRUSTED_ORIGINS` environment check

This commit is contained in:
Christopher C. Wells 2022-02-21 15:43:43 -08:00
parent 21fa57c9c1
commit dd11afe584
1 changed files with 3 additions and 1 deletions

View File

@ -243,7 +243,9 @@ SESSION_COOKIE_HTTPONLY = True
# https://docs.djangoproject.com/en/4.0/ref/csrf/#settings # https://docs.djangoproject.com/en/4.0/ref/csrf/#settings
CSRF_COOKIE_HTTPONLY = True CSRF_COOKIE_HTTPONLY = True
# CSRF_COOKIE_SECURE = True # CSRF_COOKIE_SECURE = True
CSRF_TRUSTED_ORIGINS = os.environ.get("CSRF_TRUSTED_ORIGINS", []).split(",") CSRF_TRUSTED_ORIGINS = list(
filter(None, os.environ.get("CSRF_TRUSTED_ORIGINS", "").split(","))
)
# https://docs.djangoproject.com/en/4.0/topics/auth/passwords/ # https://docs.djangoproject.com/en/4.0/topics/auth/passwords/