Bendemann
Bendemann

Reputation: 766

Hot reload in Dash does not automatically update

As announced here, Dash's hot reload is supposed to be automatically activated when debug=True. However, that is not working for me. I even tried explicitly setting dev_tools_hot_reload=True.
I save the code file from the IDE but I see no changes on the web interface thereafter.
Even reloading the page makes no difference. I have to stop the server and re-run the script.
What can be the issue?

Edit
I am working with VSCode & running the script from the windows powershell (outside the VSCode terminal).
Installing a new version from conda-forge didn't work.

Upvotes: 8

Views: 9766

Answers (1)

ruslaniv
ruslaniv

Reputation: 604

I personally could not find a satisfactory answers on either Dash docs or Dash forum. It seems like in every post you are given different instructions on how to implement hot-reloading with the refrain "it's built in and should just work." So here is anecdotical solution how it worked for me:

  • PyCharmPro 2020.1.4
  • Chrome 84.0.4147.105

file.py:

app = dash.Dash(__name__)
# Dash code
if __name__ == '__main__':
  app.run_server(debug=True, threaded=True)

If everything is working, then the tab name should change to:

enter image description here

And the page would auto-reload within about 2 seconds after hitting + S

pip freeze

  • dash==1.14.0
  • dash-core-components==1.10.2
  • dash-html-components==1.0.3
  • dash-renderer==1.6.0
  • dash-table==4.9.0
  • Flask==1.1.2

Upvotes: 4

Related Questions