How it works
A Flask app can be a single file: create the app, decorate functions with @app.route and return a response. It is built on Werkzeug (the request and routing layer) and Jinja (templates), and extensions add the rest, such as Flask-SQLAlchemy for databases, Flask-Login for sessions and Flask-WTF for forms.
Armin Ronacher released it in 2010, and the Pallets project maintains it. It is a WSGI framework: async views exist, but it lacks the async-first design of FastAPI. It remains a common choice for small services, internal tools, webhook receivers and teaching, where a tiny core that is easy to read matters more than built-in features.
Flask pros and cons
Pros
- Very small core that is quick to learn and read
- Complete freedom over structure and libraries
- Mature, with extensions for most needs
Cons
- Larger apps need discipline, because there is no set structure
- No built-in validation or API docs
- Not async-first, so FastAPI suits high-concurrency APIs better
When to use Flask
Pick it when
- Small APIs, webhook receivers and internal tools in Python
- Prototypes and teaching, where a readable single file helps
Skip it when
- You want admin, ORM and accounts ready-made (Django) or typed async APIs (FastAPI)
Flask pricing
Flask vs the alternatives
Related terms
More in Backend and APIs
Frameworks