Updated Jun 22, 2026

Flask From Zero

Flask is the micro-framework: where Django hands you a whole workshop and FastAPI hands you a sharp API tool, Flask hands you a small, clean core — routing, request/response, and templates — and lets you choose everything else (which database library, which auth, which form handling). That minimalism is its whole personality. It's why Flask is wonderful for small apps, prototypes, and learning, and why so much of the Python web world runs on it. And because the core is so small, Flask is the best framework for seeing what a web framework actually is underneath the conveniences.

We build that mental model first the whole way: a Flask app is a router that maps URLs to functions, plus a request object coming in and a response going out, plus Jinja templates for HTML — and everything else is an extension you bolt on. Once you see that, Flask stops being "the small one" and becomes "the one where nothing is hidden."

📝 This teaches the framework. It assumes you know Python — functions, decorators, classes (Python From Zero). It pairs naturally with What a Framework Even Is, and it's illuminating to compare with Django (batteries-included) and FastAPI (async APIs). Flask needs a dev server to run, so examples here are shown with the commands to run them yourself.

How to read this

Read in order — it grows one small app (a notes app) from a single file to a structured, tested, deployable project. Phases carry difficulty badges.

The phases

Part 1 — The small core (🟢 Basic)

  1. What Flask Is & Your First App 🟢 — the micro-framework idea, @app.route, and a running app in a few lines.
  2. Routing & Views 🟢 — dynamic URLs, HTTP methods, the request object, and responses.
  3. Templates with Jinja2 🟡 — render_template, the Jinja language, inheritance, and auto-escaping.

Part 2 — A real application (🟡 Intermediate → 🔴) 4. Forms & Request Data 🟡 — handling POST, request.form, validation, and CSRF. 5. Working with a Database 🟡 — Flask-SQLAlchemy, models, and CRUD — the extension model in action. 6. Blueprints & the App Factory 🔴 — structuring beyond one file, and the patterns real Flask apps use. 7. Sessions, Auth & Extensions 🟡 — sessions, Flask-Login, and the extension ecosystem that keeps Flask small.

Part 3 — APIs, testing & production (🟡 → 🟢) 8. Building a JSON API with Flask 🟡 — jsonify, REST endpoints, and when to reach for FastAPI instead. 9. Testing & Production 🟡 — the test client, pytest, and deploying with a real WSGI server. 10. Where to Go Next 🟢 — the extension landscape, Flask vs the field, and what to build.

The throughline: Flask is a small core plus your chosen extensions. That makes it the clearest window into what every web framework is doing — and a joy for anything that doesn't need the whole workshop.


Phase 1: What Flask Is & Your First App →