Blueprint-Scoped Templates and Statics
Give each blueprint its own assets.
Each Feature Owns Its Assets
A truly modular blueprint carries its own templates and static files. This keeps a feature self-contained and easy to move around.
Point to a Template Folder
When you create the blueprint, set template_folder so Flask also searches that folder when rendering this blueprint pages.
blog = Blueprint("blog", __name__,
template_folder="templates")All 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