How to implement Flask Application Dispatching by Path with WSGI?

后端 未结 2 1049
一整个雨季
一整个雨季 2021-02-03 13:43

I would like to use a single domain as a Staging Environment for multiple flask applications that will eventually run on their own domains.

Something like:

2条回答
  •  星月不相逢
    2021-02-03 14:18

    The key thing to note, here, is that you'll actually have 4 apps (3 individual apps and one combined app). This is ignoring the staging/live distinction because staging and live are just copies of each other in different directories.

    Create each of the individual apps and get them responding on their individual domains. Then create a new app that imports the application variables from the individual apps and combines them using the DispatcherMiddleware like the example under the heading "Combining Applications" on the doc page you link to.

提交回复
热议问题