add CSRF_TRUSTED_ORIGINS setting for reverse-proxied domains
Admin login (and any POST form) fails with "Origin checking failed" behind a proxy that terminates TLS, since Django had no trusted-origins list configured at all. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -51,6 +51,8 @@ if not SECRET_KEY:
|
||||
|
||||
ALLOWED_HOSTS = [h for h in os.environ.get('DJANGO_ALLOWED_HOSTS', '').split(',') if h]
|
||||
|
||||
CSRF_TRUSTED_ORIGINS = [o for o in os.environ.get('CSRF_TRUSTED_ORIGINS', '').split(',') if o]
|
||||
|
||||
|
||||
# Application definition
|
||||
|
||||
|
||||
Reference in New Issue
Block a user