From c0d890b4def30540ff011b6bf9098a954e70eeb7 Mon Sep 17 00:00:00 2001 From: "Andrey K. Choi" Date: Tue, 25 Nov 2025 07:55:24 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20CRITICAL:=20Force=20CSRF=5FTRUST?= =?UTF-8?q?ED=5FORIGINS=20at=20end=20of=20settings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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. --- smartsoltech/settings_test.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/smartsoltech/settings_test.py b/smartsoltech/settings_test.py index 9006ac6..a57f85b 100644 --- a/smartsoltech/settings_test.py +++ b/smartsoltech/settings_test.py @@ -113,4 +113,15 @@ if 'test' in sys.argv: # Отключаем сигналы для ускорения тестов if 'test' in sys.argv: from django.core.signals import setting_changed - setting_changed.disconnect() \ No newline at end of file + 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) \ No newline at end of file