Flask Blueprints explained in 5 minutes
In this article, we will go through blueprints in Flask. If you want some basics on how Flask application works, I recommend you to read my previous article on Flask — Micro web framework explained in 5 minutes.
In Flask, Blueprints allows us to break our application into modules and helps us to organize the modules in some fashion. These modules are de-coupled and also can be re-used.
For e.g.; Let us assume we have an E-commerce application, we can divide our application into different modules like inventory management, user-data management, order management, delivery management.
A blueprint will also have collection of views, templates and static files as similar to a Flask application object.
Now let us write a dummy E-commerce application using Flask Blueprints.
Prerequisites : Python2.7+, Python 3+
Installing flask using pip
On a command prompt/shell use below command to install flask using pip