import os from App import create_app # Ensure your folder name is 'App' or 'app' # Get the directory where run.py is located basedir = os.path.abspath(os.path.dirname(__file__)) # Create the application instance app = create_app() # Override paths to be relative to run.py location # NOTE: Check if your folders are 'Static' or 'static' (Linux is case-sensitive!) app.static_folder = os.path.join(basedir, 'Static') app.template_folder = os.path.join(basedir, 'Templates') @app.route('/debug-paths') def debug_paths(): return f"""

🔍 Path Debugger

Base Directory: {basedir}

Static Folder: {app.static_folder} ({'✅ Found' if os.path.exists(app.static_folder) else '❌ Not Found'})

Template Folder: {app.template_folder} ({'✅ Found' if os.path.exists(app.template_folder) else '❌ Not Found'})


Go to Homepage

""" if __name__ == '__main__': # Default port for Hugging Face Spaces is 7860 port = int(os.environ.get("PORT", 7860)) # In production, debug should be False app.run(host="0.0.0.0", port=port, debug=True)