Flask Explained: The Small Framework That Does Just Enough
Introduction Django (covered earlier) gives you everything: an ORM, an admin panel, authentication, and a project structure, decided for you. Flask, created by Armin Ronacher in 2010, gives you almost nothing — routing, request handling, and a template engine — and lets you add the rest yourself. That minimalism is the point: for small apps, APIs, and learning, a framework that stays out of the way teaches you more than one that does everything. A complete app in a few lines Flask's famous "hello world" is a whole working web app: from flask import Flask app = Flask(__name__) @app.route("/") def home(): return "Hello, Flask!" @app.route("/users/<name>") def greet(name): return f"Hello, {name}!" The @app.route decorator maps a URL to a function, <name> captures part of the URL as a variable, and returning a string sends it as the response. Add a database with an extension like Flask-SQLAlchemy, add login w...