Fix logout 403 by setting CSRF trusted origins (#18)
CI / test (pull_request) Successful in 11s
Unit Tests / test (pull_request) Successful in 10s

Django 5 rejects HTTPS POSTs without CSRF_TRUSTED_ORIGINS; derive them from ALLOWED_HOSTS and trust the reverse-proxy TLS headers in prod/beta.
This commit is contained in:
2026-07-10 13:12:17 -05:00
parent c97bd16445
commit eed8852897
6 changed files with 94 additions and 0 deletions
+2
View File
@@ -7,6 +7,8 @@ DJANGO_ENV=prod
DJANGO_DEBUG=false
DJANGO_SECRET_KEY=replace-with-a-long-random-secret
DJANGO_ALLOWED_HOSTS=aimloperations.com,www.aimloperations.com
# Optional override; when unset, https:// origins are derived from DJANGO_ALLOWED_HOSTS.
# DJANGO_CSRF_TRUSTED_ORIGINS=https://aimloperations.com,https://www.aimloperations.com
# Logging (optional override; defaults: dev=DEBUG, beta=INFO, prod=WARNING)
# DJANGO_LOG_LEVEL=WARNING