Blueprints 101
So far, our applications have all been flat: beautiful, single-file Web applications (templates and static resources not considered). In some cases, that's a nice approach; a reduced need for imports, easy to maintain with simple editors and all but…
As our applications grow, we identify the need to contextually arrange our code. Flask Blueprints allow you to modularize your project, sharding your views in "app-like" objects called blueprints that can be later loaded and exposed by your Flask application. Large applications benefit deeply from the use of blueprints, as the code gets more organized.
Feature-wise, it also helps you configure the registered view access and resource lookup in a more monolithic way. Tests, models, templates ...
Get Building Web Applications with Flask now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.