Routes and Views
Handle HTTP requests.
What is Flask?
Flask is a lightweight Python web framework. It lets you build web apps and APIs with very little boilerplate. Install it with pip install flask.
from flask import Flask
app = Flask(__name__)
print('Flask app created:', app.name)Creating the App
Every Flask app starts with an app = Flask(__name__) object. The __name__ argument helps Flask locate resources like templates.
from flask import Flask
app = Flask(__name__)
if __name__ == '__main__':
# app.run() starts the development server
print('App is ready to run')