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

Adding css with Apache


To add a custom css style sheet I used to do:

But with the new dash-core-components update I should add the xxx.css into the assets directory.

In the testing environment, when I do: python it all works correctly and the xxx.css is found and loaded correctly.

However, when I deploy to my Apache server the assets directory doesn’t seem to be found? I also note that “absolute” paths are not presently allowed for.

Is there anything else I can do?


p.s. the assets directory is has read/write access to all and is listed as order allow, deny and allow from all in the Apache conf.

I had a look at the Apache access_log and found the following:

"GET /APP/ HTTP/1.1 …
"GET /assets/xxx.css …
"GET /APP/_dash-layout …
"GET /APP/_dash-dependencies …
"POST /APP/_dash-update-component …
"POST /APP/_dash-update-component …
"POST /APP/_dash-update-component …

So it looks like dash has found the assets, but for some reason it’s not using them??

I am sharing the server with other webpages, so have to do:


perhaps this is what is causing the issue??


I needed to add:
app._assets_url_path = 'APP/assets'