Register Blueprints in the Factory
Wire all blueprints during app assembly.
The Final Assembly
With the app built and extensions bound, the last factory job is wiring up your routes. You do that by registering blueprints. 🧩
A Quick Blueprint Recall
A blueprint groups related routes into a reusable module. The factory is exactly where you attach those groups to the app.
from flask import Blueprint
main = Blueprint("main", __name__)All lessons in this course
- Problems with a Global app Object
- Write a create_app Function
- Init Extensions with init_app
- Register Blueprints in the Factory