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

Trouble loading assets folder in production

I am trying to use gevent to run a WSGI server with Dash - it appears that __name__ no longer works for locating the assets folder locally. I can probably just host everything off an S3-compliant storage solution but would like to know how to direct the assets folder to the right location. The docs mention explicitly setting __name__ - can anyone provide an example of what this would look like? Thanks.

I’ve taken a look at a similar issue (Dash app does not load assets and app.index_string), but this solution still does not resolve the issue. The assets folder is still not properly located with the dash constructor looking something like:

app = dash.Dash(
    meta_tags=[{"name": "viewport",
                "content": "width=device-width, initial-scale=1.0"}],

I am running this app via gunicorn as a pip-installable package, which may be causing some issues.


Last, I have tried serving the assets folder from a CDN with no luck…

The Dash constructor has an argument assets_folder, you could try giving that an absolute path to your assets folder?