fix: add CSRF_TRUSTED_ORIGINS support via env var
Django 5.2 rejects POSTs when the Origin header doesn't match CSRF_TRUSTED_ORIGINS. Required for non-localhost deployments. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
40e3419160
commit
6727d8b59b
1 changed files with 4 additions and 0 deletions
|
|
@ -70,3 +70,7 @@ MEDIA_ROOT = BASE_DIR / 'media'
|
||||||
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
||||||
|
|
||||||
PERENUAL_API_KEY = os.environ.get('PERENUAL_API_KEY', '')
|
PERENUAL_API_KEY = os.environ.get('PERENUAL_API_KEY', '')
|
||||||
|
|
||||||
|
_trusted = os.environ.get('CSRF_TRUSTED_ORIGINS', '')
|
||||||
|
if _trusted:
|
||||||
|
CSRF_TRUSTED_ORIGINS = [o.strip() for o in _trusted.split(',')]
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue