๐Ÿงช

Flask

Flask is an open-source, minimal Python web framework maintained by the Pallets Projects. It's the #11 most-used web framework overall, reported in roughly 14.4% of developer surveys. Developers reach for it because it's unopinionated โ€” it gives you routing and request handling and decides almost nothing else for you โ€” which makes it popular for small APIs and projects where the team wants full control over structure and dependencies.

Quick facts
Type: Minimal / micro web framework
Made by: Pallets Projects
License: Free / open-source (BSD-3-Clause)
Language: Python
Primary use case: Small-to-medium APIs and web apps that need minimal structure and full control
Jump to: ExampleGetting startedBest for

Example

A minimal Flask app maps a URL route to a Python function with a single decorator โ€” no project structure is enforced.

from flask import Flask, request, jsonify

app = Flask(__name__)

@app.route("/hello/<name>")
def hello(name):
    return jsonify({"message": f"Hello, {name}!"})

@app.route("/items", methods=["POST"])
def create_item():
    data = request.get_json()
    return jsonify({"created": data["name"]}), 201

if __name__ == "__main__":
    app.run(debug=True)

Getting started

Install Flask into a virtual environment, then run the built-in development server.

# install Flask
pip install flask

# run the dev server (app.py contains `app = Flask(__name__)`)
flask --app app run --debug
Best for: Small services, internal tools, and prototypes where you want to choose your own database layer, auth, and project layout rather than accept a framework's built-in conventions.