From 9ee78fc77031b1f2e9037e057ca998a4dd85552b Mon Sep 17 00:00:00 2001 From: thecyberlearn Date: Fri, 5 Sep 2025 08:32:32 +0530 Subject: [PATCH] Add Django startup debugging to wsgi.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add try/catch around get_wsgi_application() to capture startup errors - Print detailed error messages and traceback for debugging - Exit with error code 1 on failure to ensure container fails fast - This will help diagnose the silent Django startup failure in Dokploy 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- netcop_hub/wsgi.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/netcop_hub/wsgi.py b/netcop_hub/wsgi.py index c54a7e0..99f2f1e 100644 --- a/netcop_hub/wsgi.py +++ b/netcop_hub/wsgi.py @@ -8,9 +8,18 @@ https://docs.djangoproject.com/en/5.2/howto/deployment/wsgi/ """ import os +import sys +import traceback from django.core.wsgi import get_wsgi_application os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'netcop_hub.settings') -application = get_wsgi_application() +try: + application = get_wsgi_application() + print("Django WSGI application loaded successfully!") +except Exception as e: + print(f"FATAL ERROR during Django startup: {e}") + print("Full traceback:") + traceback.print_exc() + sys.exit(1)