#!/usr/bin/env python3 import sys import os import cgitb # Enable CGI error reporting cgitb.enable() # Add current directory to Python path current_dir = os.path.dirname(os.path.abspath(__file__)) sys.path.insert(0, current_dir) # Set environment variables os.environ.setdefault('FLASK_ENV', 'production') # Print CGI headers first print("Content-Type: text/html\n") try: # Import and run the Flask application from production_app import app # Handle CGI request from wsgiref.handlers import CGIHandler CGIHandler().run(app) except ImportError: try: from main import app from wsgiref.handlers import CGIHandler CGIHandler().run(app) except Exception as e: print(f"

Application Error

Error loading application: {e}

") except Exception as e: print(f"

Server Error

Error: {e}

")