From 3c8a0e5ba101b14dbb0dcd64f059d748f32e2296 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 12 Jul 2025 04:17:28 +0530 Subject: [PATCH] Fix CSRF_TRUSTED_ORIGINS empty string error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Filter out empty strings from CSRF_TRUSTED_ORIGINS to prevent Django 4.0+ error 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- netcop_hub/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netcop_hub/settings.py b/netcop_hub/settings.py index 1971b3f..213e11a 100644 --- a/netcop_hub/settings.py +++ b/netcop_hub/settings.py @@ -161,7 +161,7 @@ N8N_WEBHOOK_SOCIAL_ADS = config('N8N_WEBHOOK_SOCIAL_ADS', default='') OPENWEATHER_API_KEY = config('OPENWEATHER_API_KEY', default='') # Security settings -CSRF_TRUSTED_ORIGINS = config('CSRF_TRUSTED_ORIGINS', default='').split(',') +CSRF_TRUSTED_ORIGINS = [origin.strip() for origin in config('CSRF_TRUSTED_ORIGINS', default='').split(',') if origin.strip()] SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https') # Default primary key field type