Flask is a microframework for server-side web development in Python.
pip install flask
Flask can be run in two different default ways: via server variables or in script execution mode.
The Flask documentation recommends setting an environmental variable called FLASK_APP and setting it to the name of the file containing the Python code.
Once set, the command “flask run” can be used to run the script set to this value. This is the recommended production usage.
FLASK_APP=hello.py flask run
Script Execution Mode
For development settings and purposes, Flask can be run through the command-line usage of including the following:
from flask import Flask
app = Flask(name)
# Code here
if name == 'main':
When started through the run() function, Flask will run in development mode.