Black Lives Matter. Please consider donating to Black Girls Code today.

How to debug my Dash app? / Big problems serving my dash app through a WSGI server

I try hard to serve my dash apps explicitly through a WSGI server. (I need this for multi app support).

I experimented with the dev server right built-into Flask and I tried Gunicorn - in both cases I get the very undetailed error message “Error loading layout”. Other WSGI apps run fine through both WSGI servers.

How can I find out more about why the Dash app issues the Error message. What’s going on under the hood? - Can I switch on some debugging for this?

I’ve tried all sorts of things to get two dash apps running on different routes and I didn’t find a solution yet, but at least I know what’s (part of) the problem:

I cannot make Dash putting its assets under a relative path, so that I can ste a prefix path for all requests of a Dash app.

Even setting the promisingly named url_base_pathname parameter does not seem to solve it. Very strange and disappointing, but that’s what it seems to be.

Happy to be proven otherwise…

Are you using Flask Dispatcher Middleware or something similar to act as a controller for your multiple applications?

You need to set request_pathname_prefix, url_base_pathname will set both route (flask prefix) and requests (external prefix).

Are you using Flask Dispatcher Middleware or something similar to act as a controller for your multiple applications?

Thanks engaging in this! I tried indeed werkzeug.wsgi's DispatcherMiddleware when serving my Dash apps via Flask.

Additionally I experimented with a middleware layer using the Mapper object in the routes package when serving via Gunicorn.

Both so far without success.