#!/usr/bin/python3
"""
WSGI config for cPanel deployment of Yatra booking system.
This file is specifically for cPanel hosting environments.
"""
import sys
import os

# Add your project directory to Python path
sys.path.insert(0, os.path.dirname(__file__))

# Set Django settings module
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'yatra_testing.settings')

# Import Django WSGI application
try:
    from django.core.wsgi import get_wsgi_application
    application = get_wsgi_application()
except Exception as e:
    # Log the error for debugging
    import traceback
    with open('/tmp/wsgi_error.log', 'w') as f:
        f.write(f"WSGI Error: {str(e)}\n")
        f.write(traceback.format_exc())
    raise