Pythonflaskv3.1.3
PythonBeginner-friendly

flask

A simple framework for building complex web applications

web-frameworkwsgiroutingmicroframeworkpythonapplicationapplication-frameworksdynamic-contentflaskjinja
The Problem

Django's 'batteries included' approach is a blessing for large apps but a burden for small ones โ€” you get an ORM, admin panel, and template engine whether you want them or not. Armin Ronacher built Flask as a microframework: give developers the essentials (routing, request/response) and let them pick everything else.

Mental Model

Flask is a WSGI application at its core. You register routes with @app.route() decorators, and each route is just a Python function that returns a response. There's no magic โ€” what you see is what runs. Extensions (SQLAlchemy, Flask-Login, etc.) slot in cleanly when you need them.

60-second start

Install flask

pip install flask
import flask

Use it when

Use Flask for small-to-medium web apps and APIs where you want to control the stack, for prototypes where you need something running fast, or when teaching web development concepts without the complexity of Django.

Skip it when

Flask becomes painful as an app grows โ€” you end up assembling Django yourself from extensions. For async APIs, FastAPI is a better starting point. For anything needing built-in auth, admin, or ORM, Django pays off faster.

Alternatives
fastapiBetter for pure APIs โ€” adds async support, automatic validation, and OpenAPI docs
djangoChoose Django when you need an ORM, admin panel, or auth out of the box
starletteASGI-native microframework; Flask's spiritual successor for async applications

Ready to explore the full API?

See every class, function, and relationship in an interactive graph.