flask-restful 和 flask 中命名空间和蓝图的区别

Difference between namespaces and blueprints in flask-restful and flask

我无法理解蓝图和命名空间在 Web 应用程序中的用途。 我阅读了文档,但无法准确理解。
如果您能针对每种情况给出简单的解释并举例说明,那将对我很有帮助。
谢谢!

根据 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.

来自:http://flask-restplus.readthedocs.io/en/stable/scaling.html

命名空间来自 Flask-RESTPlus,而蓝图来自 Flask,用于组织您的应用程序。

the namespaces modules (specific to Flask-RESTPlus) are reusable namespaces designed like you would do with Flask’s Blueprint.

我可能仍然遗漏了一些东西,但 this tutorial 似乎更清楚地说明了文档。

关于 评论:

why should anyone choose to use a Blueprint over a Namespace (or viceversa) when both claim to have the same purpose?

Namespaces 似乎旨在在给定的 API 中组织 REST 端点,而 Blueprints,在这种情况下,根据 Flask 的设计规范,似乎旨在允许多个 API 与 Flask App 上的其他 API 或非 REST 路由混合和匹配。