实现一个Flask蓝图,以便可以安全地安装多次?

2024-04-30 01:10:25 发布

您现在位置:Python中文网/ 问答频道 /正文

烧瓶文件上说:

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.

但我似乎不知道必须做些什么才能安全地绘制蓝图。在


Tags: 文件youregisterthat烧瓶notitmultiple
1条回答
网友
1楼 · 发布于 2024-04-30 01:10:25

很难回答这样的问题,因为它太笼统了。

首先,您的蓝图需要以一种不假设它将注册到的应用程序对象的状态的方式来实现。其次,您需要使用可配置的url方案来防止路由冲突。

这其中有更细微的组成部分,但在没有看到您的具体代码和问题的情况下,这是我觉得我可以得到的具体。

相关问题 更多 >