Flask 文档说:
that you can register blueprints multiple times though not every blueprint might respond properly to that. In fact it depends on how the blueprint is implemented if it can be mounted more than once.
但我似乎无法不止一次地找出必须做什么才能安全地安装蓝图。
最佳答案
很难回答这样的问题,因为它太笼统了。
首先,您的蓝图需要以不假设其将注册到的应用对象的状态的方式实现。其次,您需要使用可配置的 url 方案来防止路由冲突。
其中有更多细微差别的组成部分,但在没有看到您的具体代码和问题的情况下,它已经是我能得到的最具体的了。
关于python - 实现 Flask 蓝图以便可以安全地多次安装它?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14503387/