Flask
Flask is a lightweight WSGI web application framework in Python, designed with simplicity and flexibility in mind. The current version is 3.1.3, released on March 28, 2026, following a regular release cadence with feature and fix updates as needed.
Warnings
- breaking Flask 3.1.3 includes a security fix that may affect session behavior. Review the release notes for details.
- gotcha Relative imports can cause issues if not used correctly. Ensure your project structure supports them to avoid ImportError.
Install
-
pip install flask
Imports
- Flask
from flask import Flask
- render_template
from flask import render_template
- request
from flask import request
Quickstart
from flask import Flask, render_template, request
app = Flask(__name__)
@app.route('/')
def index():
return render_template('index.html')
if __name__ == '__main__':
app.run(debug=True)