Skip to content

Building support for decoupling Dash from Flask and supporting Quart / FastAPI servers#3430

Open
BSd3v wants to merge 123 commits intoplotly:devfrom
BSd3v:bring-your-own-server
Open

Building support for decoupling Dash from Flask and supporting Quart / FastAPI servers#3430
BSd3v wants to merge 123 commits intoplotly:devfrom
BSd3v:bring-your-own-server

Conversation

@BSd3v
Copy link
Contributor

@BSd3v BSd3v commented Sep 9, 2025

This is an open PR draft, to contribute please target my forked branch.

The goal of this PR is to modularize the Dash setup to be independent of Flask (will fallback to Flask) and allow devs to configure their own backend.

  • decouple callback context from Flask Request
  • decouple index, assets, etc from build
  • build Quart server support
  • build FastAPI server support
  • allow for custom server build
  • add tests for servers

fixes #1571

@gvwilson gvwilson added feature something new P2 considered for next cycle community community contribution labels Sep 10, 2025
Comment on lines +247 to +249
:param backend: The backend to use for the Dash app. Can be a string
(name of the backend) or a backend class. Default is None, which
selects the Flask backend. Currently, "flask", "fastapi", and "quart" backends
Copy link
Member

@LiamConnors LiamConnors Feb 6, 2026

Choose a reason for hiding this comment

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

Does the server param docstring above need an update too?

Question - For the difference between the too - is it you'd use server if you want Dash to use an existing instance of the server? vs backend if you want Dash to create the instance?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I believe so.

You should be able to pass a preconfigured server of any of the supported types.

@T4rk1n T4rk1n requested a review from camdecoster as a code owner February 13, 2026 17:16
@T4rk1n
Copy link
Contributor

T4rk1n commented Feb 19, 2026

@BSd3v This is looking good, I have made some significant changes to the fastapi implementation. The config is now transfered via environment variable and I merged all the middlewares into one.

Could you review those changes, then we can merge and release a rc version 🚀

@BSd3v
Copy link
Contributor Author

BSd3v commented Feb 20, 2026

@T4rk1n

I dont know that I necessarily agree with keeping the logic of set_header here, this appends to an already defined key, where as set makes the dev believe they are overriding. This function was done this way since headers.add in Flask is handled this way.

I think we should explicitly make it to where it is set, and if people want to append, then we can possibly expose a secondary headers append_header?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community community contribution feature something new P2 considered for next cycle

Projects

None yet

Development

Successfully merging this pull request may close these issues.

provide support for FastAPI / other ASGI

6 participants

Comments