Skip to content
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

serving css and js locally and adding local css files to dash [Question/ possible issue?] #121

Closed
yosiz opened this issue Feb 28, 2019 · 5 comments
Labels
question Further information is requested

Comments

@yosiz
Copy link

yosiz commented Feb 28, 2019

setting serve_locally to True when creating DjangoDash seems to result in an error,
is there anything that needs to be done for this to work?

Also,
was trying to add local css files which doesn't seem to work - not sure what is the correct way of doing it

Tried:
app.css.append_css('/static/loader.css')

(to load the 'loading...' animation for long callbacks)

@GibbsConsulting
Copy link
Owner

This is similar to #37 and needs coding - hence #122

As a workaround until a fix is available, you could use the not-in-iframe approach and add the css to your page template.

@GibbsConsulting GibbsConsulting added the question Further information is requested label Mar 2, 2019
@GibbsConsulting
Copy link
Owner

@yosiz can you provide more colour on your comments regarding serve_locally not working? For component constituents (as opposed to extra content in an application assets subdirectory) this should be working.

@yosiz
Copy link
Author

yosiz commented Mar 4, 2019

It might be that I'm not doing it correctly,
Do I need to generate the just scripts and css locally for the serve locally to work?
I just set it to true and it couldn't find all the assets

@GibbsConsulting
Copy link
Owner

At the moment, the serve_locally flag works for components, up to limitations from the underlying Dash implementation. Hence the workaround in #84

Independently of this flag, django-plotly-dash does not currently serve any local assets (from the assets subdirectory or similar), hence #122

Until that is done, your best workaround is to use your own template - ie something based on the plotly-direct template tag

@GibbsConsulting
Copy link
Owner

Local assets should now work as #133 has been merged to trunk and released in 0.9.9, although the documentation is not as good as one might wish.
Each component should be picked up by the static files finders, as should each assets directory associated with a DjangoDash instance.

Handle local assets automation moved this from To do to Done Sep 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
Development

No branches or pull requests

2 participants