A blueprint is a template for generating a "section" of a web application. You can think of it as a mold:

You can take the blueprint and apply it to your application in several places. Each time you apply it the blueprint will create a new version of its structure in the plaster of your application.

# An example
from flask import Blueprint

tree_mold = Blueprint("mold", __name__)

@tree_mold.route("/leaves")
def leaves():
    return "This tree has leaves"

@tree_mold.route("/roots")
def roots():
    return "And roots as well"

@tree_mold.route("/rings")
@tree_mold.route("/rings/<int:year>")
def rings(year=None):
    return "Looking at the rings for {year}".format(year=year)

This is a simple mold for working with trees - it says that any application that deals with trees should provide access to its leaves, its roots, and its rings (by year). By itself, it is a hollow shell - it cannot route, it cannot respond, until it is impressed upon an application:

from tree_workshop import tree_mold

app.register_blueprint(tree_mold, url_prefix="/oak")
app.register_blueprint(tree_mold, url_prefix="/fir")
app.register_blueprint(tree_mold, url_prefix="/ash")

Once it is created it may be "impressed" on the application by using the register_blueprint function - this "impresses" the mold of the blueprint on the application at the locations specified by url_prefix.

Answer from Sean Vieira on Stack Overflow
🌐
Flask
flask.palletsprojects.com › en › stable › blueprints
Modular Applications with Blueprints — Flask Documentation (3.1.x)
The basic concept of blueprints is that they record operations to execute when registered on an application. Flask associates view functions with blueprints when dispatching requests and generating URLs from one endpoint to another.
Top answer
1 of 6
343

A blueprint is a template for generating a "section" of a web application. You can think of it as a mold:

You can take the blueprint and apply it to your application in several places. Each time you apply it the blueprint will create a new version of its structure in the plaster of your application.

# An example
from flask import Blueprint

tree_mold = Blueprint("mold", __name__)

@tree_mold.route("/leaves")
def leaves():
    return "This tree has leaves"

@tree_mold.route("/roots")
def roots():
    return "And roots as well"

@tree_mold.route("/rings")
@tree_mold.route("/rings/<int:year>")
def rings(year=None):
    return "Looking at the rings for {year}".format(year=year)

This is a simple mold for working with trees - it says that any application that deals with trees should provide access to its leaves, its roots, and its rings (by year). By itself, it is a hollow shell - it cannot route, it cannot respond, until it is impressed upon an application:

from tree_workshop import tree_mold

app.register_blueprint(tree_mold, url_prefix="/oak")
app.register_blueprint(tree_mold, url_prefix="/fir")
app.register_blueprint(tree_mold, url_prefix="/ash")

Once it is created it may be "impressed" on the application by using the register_blueprint function - this "impresses" the mold of the blueprint on the application at the locations specified by url_prefix.

2 of 6
14

As pointed out in a comment by @Devasish, this article provides a good answer:

http://exploreflask.com/en/latest/blueprints.html
[Edit: The above URL is dead, but you can see it on archive.org]

Quoting from the article:

An example of this would be Facebook. If Facebook used Flask, it might have blueprints for the static pages (i.e. signed-out home, register, about, etc.), the dashboard (i.e. the news feed), profiles (/robert/about and /robert/photos), settings (/settings/security and /settings/privacy) and many more. These components all share a general layout and styles, but each has its own layout as well

This is a very good interpretation, especially the part "if Facebook used Flask". It gives us a concrete situation to visualize how Blueprint actually works.

🌐
GeeksforGeeks
geeksforgeeks.org › python › flask-blueprints
Flask Blueprints - GeeksforGeeks
July 23, 2025 - The main idea behind Blueprints is to organize a Flask application into separate modules, each handling a specific feature with its own routes, templates, and static files. This helps keep the application structured and reduces complexity.
🌐
DigitalOcean
digitalocean.com › community › tutorials › how-to-structure-a-large-flask-application-with-flask-blueprints-and-flask-sqlalchemy
How To Structure a Large Flask Application with Flask Blueprints and Flask-SQLAlchemy | DigitalOcean
November 19, 2022 - In the prior example, you can use blueprints to structure your large social media application with different blueprints, such as a users’ blueprint, a blueprint for posts, one for followers, and so on for each feature. In this tutorial, you’ll use Flask blueprints to structure a web application with three components: the main blueprint containing the home page and other main routes, a posts blueprint for managing blog posts, and a questions blueprint for questions and answers.
🌐
Readthedocs
explore-flask.readthedocs.io › en › latest › blueprints.html
Blueprints — Explore Flask 1.0 documentation
To create a blueprint object, we import the Blueprint() class and initialize it with the arguments name and import_name. Usually import_name will just be __name__, which is a special Python variable containing the name of the current module. We’re using a functional structure for this Facebook example. If we were using a divisional structure, we’d want to tell Flask that the blueprint has its own template and static directories.
🌐
Real Python
realpython.com › flask-blueprint
Use a Flask Blueprint to Architect Your Applications – Real Python
February 6, 2021 - Flask is a very popular web application framework that leaves almost all design and architecture decisions up to the developer. In this tutorial, you’ll learn how a Flask Blueprint, or Blueprint for short, can help you structure your Flask application by grouping its functionality into reusable components.
🌐
OneUptime
oneuptime.com › home › blog › how to use flask blueprints for modular applications
How to Use Flask Blueprints for Modular Applications
January 27, 2026 - A Blueprint is a way to organize related views, templates, and other code. Think of it as a mini-application that can be registered on your main Flask app.
🌐
Hackers and Slackers
hackersandslackers.com › flask-blueprints
Organize Flask Apps with Blueprints
August 20, 2024 - We can organize our Flask apps via a built-in concept called Blueprints, which are essentially the Flask equivalent of Python modules. Blueprints are intended to encapsulate feature-sized sections of our application, such as checkout flows, ...
Find elsewhere
🌐
Flask
flask.palletsprojects.com › en › stable › tutorial › views
Blueprints and Views — Flask Documentation (3.1.x)
Flask uses patterns to match the ... direction and generate a URL to a view based on its name and arguments. A Blueprint is a way to organize a group of related views and other code....
🌐
Beautiful Soup
tedboy.github.io › flask › generated › generated › flask.Blueprint.html
flask.Blueprint — Flask API
flask.Blueprint · View page source ... · Represents a blueprint. A blueprint is an object that records functions that will be called with the BlueprintSetupState later to register functions or other things on the main application....
🌐
GitHub
github.com › hackersandslackers › flask-blueprint-tutorial
GitHub - hackersandslackers/flask-blueprint-tutorial: :blue_book: Structure your Flask apps in a scalable and intelligent way using Blueprints. · GitHub
:blue_book: :package: Structure your Flask apps in a scalable and intelligent way using Blueprints. - GitHub - hackersandslackers/flask-blueprint-tutorial: :blue_book: Structure your Flask apps in a scalable and intelligent way using Blueprints.
Author   hackersandslackers
🌐
DEV Community
dev.to › ikechukwu › what-is-flask-blueprints-structuring-project-with-blueprints-4md5
What is Flask Blueprints? Structuring Project with Blueprints - DEV Community
February 20, 2023 - Using blueprints, you can create a flexible and extensible application structure that allows you to add new features and functionality without disrupting the existing codebase. ... Create your project folder, inside it create app.py file.
🌐
freeCodeCamp
freecodecamp.org › news › how-to-use-blueprints-to-organize-flask-apps
How to Use Blueprints to Organize Your Flask Apps
September 1, 2022 - Now, this is where Flask Blueprints come into picture. Blueprints help you structure your application by organizing the logic into subdirectories.
🌐
YouTube
youtube.com › watch
Flask Blueprints Make Your Apps Modular & Professional - YouTube
Today we learn about Flask blueprints and how they make your applications more modular.◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾📚 Programming Books & Merch 📚🐍 The Python Bible Bo...
Published   April 24, 2023
🌐
Readthedocs
flask-ptbr.readthedocs.io › en › latest › blueprints.html
Modular Applications with Blueprints — Flask 0.9 documentation
The basic concept of blueprints is that they record operations to execute when registered on an application. Flask associates view functions with blueprints when dispatching requests and generating URLs from one endpoint to another.
🌐
Medium
medium.com › innovation-res › flask-blueprints-tutorial-74862e5a19fd
Flask Blueprints Tutorial. Blueprints and Views | by Giannis Skaltsas | Innovation-res | Medium
December 17, 2021 - Flask Blueprints Tutorial Blueprints and Views Flask uses a concept of blueprints for making application components and supporting common patterns within an application or across applications
🌐
Medium
medium.com › @neluwah › demystifying-flask-blueprints-a-simple-guide-08dbf5f3501b
Demystifying Flask Blueprints: A Simple Guide | by Noble Eluwah | Medium
February 2, 2024 - Blueprints are like the architectural plans for each individual building on your campus. They allow you to organize your application into distinct components, each with its own set of routes, templates, and static files, similar to how each ...
🌐
Medium
medium.com › @basubinayak05 › learning-flask-a-z-blueprints-3ae95db95443
Learning Flask A … Z: Blueprints. Part VII: A-Z of Blueprint | by Binayak Basu | Medium
October 12, 2024 - Blueprint in Flask is a way to organize a Flask application into smaller, reusable components. It allows you to structure your application into modular parts, each with its own routes, templates, static files, and error handlers.
🌐
Apiflask
apiflask.com › api › blueprint
APIFlask - APIBlueprint
Flask's Blueprint object with some web API support.