Fix CSRF behind Nginx by configuring trusted origins via environment.

Reads CSRF_TRUSTED_ORIGINS and USE_HTTPS from env so admin login works correctly behind HTTPS reverse proxies.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Pirmin Hinderling (fedora)
2026-07-07 19:49:41 +02:00
parent db3558872e
commit ae71704cc5
3 changed files with 23 additions and 7 deletions
+7
View File
@@ -1,3 +1,10 @@
# Django (Produktion)
DJANGO_DEBUG=False
DJANGO_SECRET_KEY=change-me
ALLOWED_HOSTS=faktenkompass.example.com
CSRF_TRUSTED_ORIGINS=https://faktenkompass.example.com
USE_HTTPS=True
# OpenAI API-Schlüssel für den Fakten-Assistenten im Admin
OPENAI_API_KEY=sk-...