blueprint和redprint的使用场景区分
来源:4-1 关于“用户”的思考

amberskier
2018-07-25
从您的课程里了解到,blueprint用于更大范围的组织,下面包含redprint,按照官方的blueprint定义:
A Blueprint is a way to organize a group of related views and other code. Rather than registering views and other code directly with an application, they are registered with a blueprint. Then the blueprint is registered with the application when it is available in the factory function.
这里看到blueprint也是用于组织视图函数的,您举的blueprint例子仅用于版本号区分v1,这个例子对我们来说不是很清晰,除了版本区分之外,blueprint可以怎么用?能否给几个更感性的例子?能够体现出和redprint的显著不同
写回答
1回答
-
这个在flask高级编程中其实是有探讨的,比如api可以包含管理系统也就是cms,那么cms admin就是一个蓝图。然后一个API也可以包含多个子项目,子项目也可以是蓝图。
022019-09-20
相似问题