How do you create a basic Flask application?

Answer

Create a Flask app in minimal code: from flask import Flask; app = Flask(__name__); @app.route('/') def home(): return 'Hello World'; if __name__ == '__main__': app.run(debug=True). The Flask(__name__) creates the app instance — __name__ tells Flask where to look for templates and static files. @app.route('/') registers the function as the handler for GET /. app.run(debug=True) starts the development server with auto-reload. For production, use Gunicorn: gunicorn app:app -w 4. The Flask application object is the central point — you register routes, configure extensions, and create the WSGI callable through it. __name__ is important: it helps Flask find your package resources relative to the file.