Before Dash 2.0, it was possible to attach multiple dash.Dash app instances to a single flask.Flask server instance by passing the same Flask server in to each Dash app using the server param. This pattern was for a time documented in the Dash docs. Since then, a number of Dash features have been introduced which involve dash.Dash instances setting global state associated with the app in the dash module. This means that it is not longer safe to run multiple Dash instances within the same process (and hence has been removed from the docs).
Since the docs briefly officially supported this pattern, and there are a numerous places online of people sharing solutions of how to attach multiple Dash instances to a Flask server, it would be good for the Dash docs to explicitly call out that spinning up more than one Dash instance in a process is not supported, and is likely to break things in fun and unexpected behaviour.
Links with now unsupported multi Dash-app solutions
Dash features relying on global state
- The
dash.callback decorator
- Dash Pages
get_asset_url()
Before Dash 2.0, it was possible to attach multiple
dash.Dashapp instances to a singleflask.Flaskserver instance by passing the same Flask server in to each Dash app using theserverparam. This pattern was for a time documented in the Dash docs. Since then, a number of Dash features have been introduced which involvedash.Dashinstances setting global state associated with the app in thedashmodule. This means that it is not longer safe to run multiple Dash instances within the same process (and hence has been removed from the docs).Since the docs briefly officially supported this pattern, and there are a numerous places online of people sharing solutions of how to attach multiple Dash instances to a Flask server, it would be good for the Dash docs to explicitly call out that spinning up more than one Dash instance in a process is not supported, and is likely to break things in fun and unexpected behaviour.
Links with now unsupported multi Dash-app solutions
Dash features relying on global state
dash.callbackdecoratorget_asset_url()