"""
Passenger WSGI entry point for cPanel "Setup Python App".

cPanel auto-generates a stub passenger_wsgi.py — REPLACE its contents with this file.
This file is what cPanel runs to start your Django app.
"""
import os
import sys

# Add project directory to Python path
sys.path.insert(0, os.path.dirname(__file__))

# Activate the virtualenv that cPanel created
# (cPanel sets VIRTUAL_ENV automatically; this is a safety net)
INTERP = os.path.join(os.environ.get('VIRTUAL_ENV', ''), 'bin', 'python')
if INTERP and os.path.exists(INTERP) and sys.executable != INTERP:
    os.execl(INTERP, INTERP, *sys.argv)

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings')

from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
