"""Passenger entrypoint for cPanel Python App.

cPanel's Setup Python App auto-generates a stub. This replaces it with the
real Django WSGI loader pointed at the production settings module.

Sequence:
  1. Insert the application root onto sys.path so `import opassecure` works.
  2. Force DJANGO_SETTINGS_MODULE = opassecure.settings.prod.
  3. Hand off to Django's WSGI application.
"""
import os
import sys

APP_ROOT = os.path.dirname(os.path.abspath(__file__))
if APP_ROOT not in sys.path:
    sys.path.insert(0, APP_ROOT)

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'opassecure.settings.prod')

from django.core.wsgi import get_wsgi_application  # noqa: E402

application = get_wsgi_application()
