quantumtaskai-caprover/netcop_hub/wsgi.py
thecyberlearn 9ee78fc770 Add Django startup debugging to wsgi.py
- 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 <noreply@anthropic.com>
2025-09-05 08:32:32 +05:30

26 lines
639 B
Python

"""
WSGI config for netcop_hub project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
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')
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)