Black Lives Matter. Please consider donating to Black Girls Code today.
Dash HoloViews is now available! ✅Check out the new docs.

Reloading CSS automatically

Hi,

Is there a way to reload CSS automatically after restart? If old css is found then Dash doesn’t reload it so I have to clear cookies every time.

Related code:

app.css.config.serve_locally = True
app.scripts.config.serve_locally = True

@app.server.route(’/static/path:path’)
def static_file(path):
static_folder = os.path.join(os.getcwd(), ‘static’)
return send_from_directory(static_folder, path)

Thanks!

Keep your browser’s dev tools open and make sure the “clear cache” checkbox is clicked: https://stackoverflow.com/a/7000899/4142536

1 Like

Thanks!!! :smiley: