Between Django and nothing
In 2010 Python web is dominated by Django (“batteries-included” framework, ORM, admin, forms, auth), web.py, Pylons/TurboGears. Missing, however, is a minimal, modular option suited to microservices or small APIs. Armin Ronacher, author of Werkzeug (WSGI toolkit) and Jinja2 (template engine), publishes on 1 April 2010 as a joke called Flask: a microframework. It turns out so solid that it becomes serious.
The release
Flask 0.1 is released on 16 April 2010. BSD-3-Clause licence. Built on:
- Werkzeug — WSGI utilities, routing
- Jinja2 — template engine
from flask import Flask
app = Flask(__name__)
@app.route("/")
def index():
return "Hello, World!"
if __name__ == "__main__":
app.run(debug=True)
Three lines for a working web server.
Philosophy
- Microframework — minimal core, extensible via optional libraries
- Unopinionated — no imposed ORM, no mandatory project structure
- Decorator routing —
@app.route("/path")intuitive - Context locals —
request,session,gaccessible globally but thread-safe - Blueprints — modular organisation in large apps
- Native Jinja2 — powerful server-side templates
Extensions
The Flask ecosystem grows enormously:
- Flask-SQLAlchemy — ORM integration
- Flask-Login, Flask-Security — authentication
- Flask-Migrate — Alembic migrations
- Flask-WTF — forms with CSRF
- Flask-RESTful, Flask-RESTX — REST APIs
- Flask-SocketIO — WebSocket
Adoption
Flask has been the preferred framework for:
- Small and medium REST APIs
- Python microservices
- Rapid prototyping
- ML model serving before FastAPI
- Educational applications
Many famous Python projects were written in Flask: Pinterest (in part), LinkedIn (some internal tools), Netflix (some services), Reddit (some sections).
Flask 2.0 and successors
- Flask 1.0 (April 2018) — stabilisation
- Flask 2.0 (May 2021) — basic async support, Python 3.7+
- Flask 3.0 (September 2023) — Python 3.8+, removal of deprecated APIs
FastAPI (2018) inherits many Flask ideas (decorators, minimalism) but adds native async, type hints, Pydantic validation, automatic OpenAPI — progressively becoming the preferred alternative for new REST APIs.
In the Italian context
Flask is present in many Italian companies doing AI/ML, data science, Python microservices. Many ML-oriented Italian startups (EALD, RoarBot, various academic spin-offs) have used Flask to expose models. Still today a high percentage of Python APIs in production in Italy runs on Flask.
References: Flask 0.1 (16 April 2010). Armin Ronacher. BSD-3-Clause licence. Built on Werkzeug and Jinja2. Flask-SQLAlchemy, Flask-Login, Flask-RESTful ecosystem. Evolution to Flask 2.0 (2021), 3.0 (2023).
