Skip to content

Make dash wsgi compliant #3323

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ This project adheres to [Semantic Versioning](https://semver.org/).

- [#3303](https://github.com/plotly/dash/pull/3303) Improve flatten_grouping performance (callback with dictionary output/input)
- [#3304](https://github.com/plotly/dash/pull/3304) Speed up function _operation by 80%
- [#3323](https://github.com/plotly/dash/pull/3323) Make Dash instances WSGI compliant, can now call gunicorn on the dash app itself.

## [3.0.4] - 2025-04-24

Expand Down
8 changes: 8 additions & 0 deletions dash/dash.py
Original file line number Diff line number Diff line change
Expand Up @@ -2395,3 +2395,11 @@ def update(pathname_, search_, **states):
Output(_ID_DUMMY, "children"),
Input(_ID_STORE, "data"),
)

def __call__(self, environ, start_response):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice 👌 no need to add server = app.server anymore

"""
This method makes instances of Dash WSGI-compliant callables.
It delegates the actual WSGI handling to the internal Flask app's
__call__ method.
"""
return self.server(environ, start_response)