"""Development entry point for the Team Tryouts application. Usage (from the project root): python run.py Production uses Waitress, from the project root as well: python wsgi.py These two are the only entry points. app/app.py exposes the factory and nothing else. Environment variables: FLASK_DEBUG: 'true' turns on the reloader and the interactive debugger. Off by default — the Werkzeug debugger executes code submitted through the browser, so a process left running with it on is a remote shell. Opt in per session, never in a deployed .env. DEV_HOST: interface to bind (default 127.0.0.1, loopback only). DEV_PORT: port to listen on (default 5000). """ import os import sys # Ensure the project root is on sys.path so 'app' is importable as a package sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) from app.app import create_app # noqa: E402 if __name__ == '__main__': app = create_app() debug_mode = os.getenv('FLASK_DEBUG', 'false').lower() == 'true' if debug_mode: app.logger.warning( 'Running in DEBUG mode with the Flask built-in server. The ' 'interactive debugger accepts code from the browser: do not ' 'leave this reachable from anywhere but this machine.' ) app.run( debug=debug_mode, host=os.getenv('DEV_HOST', '127.0.0.1'), port=int(os.getenv('DEV_PORT', 5000)), )