Blueprints - what is the concept? What is it for?

2

As I voted for Flask (python), I now see so many examples using blueprints. What are? What are they for?

    
asked by anonymous 14.06.2016 / 21:12

1 answer

2

The Blueprints, in my humble opinion, have a very bad name. If they were called "areas" or "sections" or "subsites" nobody would scratch their heads to try to understand.

In fact Blueprints are very simple and useful mainly to organize your app when it starts to get very big.

You use blueprints to separate the parts (sections) of your site, such as namespaces. With separate parts, you can do things like add before_request callbacks only to specific blueprints, error handlers , separate the templates and / or static files from each blueprint into different directories, create global or filters for templates, etc.

In short, it's hard to keep a great app without using blueprints and not going crazy.

    
06.07.2016 / 20:53