Document that a maximum 1 Dash instance is supported in a process at a time
@LiamConnors is already working on this.
Since Jul 24, 2024.
- Dominant language
- Python
- Stars
- 24.4k
- Forks
- 2.3k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 13
Description
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
- https://github.com/plotly/dash/pull/70
- https://towardsdatascience.com/embed-multiple-dash-apps-in-flask-with-microsoft-authenticatio-44b734f74532
- https://stackoverflow.com/a/59628371/77533
- https://stackoverflow.com/a/51855852/77533
- https://stackoverflow.com/a/51255720/77533
- https://community.plotly.com/t/how-to-add-your-dash-app-to-flask/51870
- https://community.plotly.com/t/embedding-more-than-one-multi-page-dash-apps-in-a-flask-app/70945
Dash features relying on global state
- The
dash.callbackdecorator - Dash Pages
get_asset_url()
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.