Create and Register a Blueprint
Define a Blueprint and attach it to the app.
Two Steps to a Blueprint
Working with a blueprint is two moves: first you define it in its own module, then you register it on the app. Let us walk through both.
Import the Blueprint Class
Everything starts with one import. The Blueprint class comes straight from flask, just like the Flask app object does.
from flask import BlueprintAll lessons in this course
- Why Blueprints Beat One Giant File
- Create and Register a Blueprint
- URL Prefixes and Blueprint url_for
- Blueprint-Scoped Templates and Statics