🔧 CRITICAL: Force CSRF_TRUSTED_ORIGINS at end of settings
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
- Added final override of CSRF_TRUSTED_ORIGINS at end of file - Django 4.0+ compliance with proper scheme formatting - Added debug print to verify final values - Should resolve persistent 4_0.E001 error in CI Previous attempts failed because settings were being overridden after our initial definition. This ensures final precedence.
This commit is contained in:
@@ -113,4 +113,15 @@ if 'test' in sys.argv:
|
|||||||
# Отключаем сигналы для ускорения тестов
|
# Отключаем сигналы для ускорения тестов
|
||||||
if 'test' in sys.argv:
|
if 'test' in sys.argv:
|
||||||
from django.core.signals import setting_changed
|
from django.core.signals import setting_changed
|
||||||
setting_changed.disconnect()
|
setting_changed.disconnect()
|
||||||
|
|
||||||
|
# КРИТИЧЕСКИ ВАЖНО: Финальное переопределение CSRF_TRUSTED_ORIGINS
|
||||||
|
# Django 4.0+ требует схемы (http://, https://)
|
||||||
|
CSRF_TRUSTED_ORIGINS = [
|
||||||
|
'http://localhost',
|
||||||
|
'http://127.0.0.1',
|
||||||
|
'http://postgres',
|
||||||
|
'https://smartsoltech.kr'
|
||||||
|
]
|
||||||
|
|
||||||
|
print("🔒 ФИНАЛЬНАЯ проверка CSRF_TRUSTED_ORIGINS:", CSRF_TRUSTED_ORIGINS)
|
||||||
Reference in New Issue
Block a user