I am unable to understand the what purpose does blueprints and namespaces serve in web app.
I read the documentation but cannot figure it out exactly.
It would be really helpful for me if you give a simple explanation with example for each case.
Thanks!

- 885
- 4
- 12
- 16
2 Answers
I may still be missing something, but this tutorial seems to clarify the documentation a bit more.
Regarding @code_dredd's comment:
why should anyone choose to use a Blueprint over a Namespace (or viceversa) when both claim to have the same purpose?
Namespaces appear to be intended for organizing REST endpoints within a given API, whereas Blueprints, in this context, appear to be intended for allowing multiple APIs to be mixed and matched with other APIs or non-REST routes on a Flask App
, according to Flask's design specification.

- 1,749
- 18
- 28
As per flask-restplus:
Flask-RESTPlus provides a way to use almost the same pattern as Flask’s blueprint. The main idea is to split your app into reusable namespaces.
from: http://flask-restplus.readthedocs.io/en/stable/scaling.html
namespace is from the Flask-RESTPlus and Blueprint is from flask to organize your app.
the namespaces modules (specific to Flask-RESTPlus) are reusable namespaces designed like you would do with Flask’s Blueprint.

- 172
- 1
- 12
-
25I fail to see how this explains _anything_ by simply quoting the docs, when it's the docs themselves that created the confusion in the first place by having them claim that one is, basically, like the other. For example, _why_ should anyone choose to use a Blueprint over a Namespace (or viceversa) when both claim to have the same purpose? This is what I was hoping to see b/c, after several days of playing around with flask and some extensions, I have to say that the documentation is and confusing in most areas. – code_dredd Feb 05 '19 at 23:02