Dash server not updating through examples - not able to stop the previous server?

A reproducible example would help a lot, with very clear instructions on the actual code you used (with links so others can try), what steps you’re doing, what you expected, and what actually happened. I’m guessing, for example, that you are wondering why it didn’t reload on the fly when you pasted it into your editor?

I’m just going by when you say you “load one” and then say that you copied it into your editor and chose run. I don’t have this editor, but I did an example like so:

  • created a file, test-app.py, pasted in this components example, saved file
  • opened a terminal and went to the directory, then did python test-app.py
  • I get this output:
 * Running on http://127.0.0.1:8050/ (Press CTRL+C to quit)
 * Restarting with stat
 * Debugger is active!
 * Debugger PIN: 123-456-789
  • I then deleted the contents of my file, pasting in the second example from here (multi-colored scatter plot)
  • upon saving, I get this in the terminal (still running):
* Detected change in '/path/to/dash-reload-test/test-app.py', reloading
 * Restarting with stat
  • when I Ctrl-R on the screen, the component example is gone and I have the scatter plot

Hopefully that helps a little bit? Without more details, I’m guessing, but the only things that come to mind are:

  • as far as I know, you will need to reload the page to see the new app. It won’t reload itself (at least without doing something to make that happen in the code)
  • note that the second example does not feature the debug=T arg to app.run_server(). This is what provides the instant restart of the server upon a file change. When I Ctrl-c to kill my running server, then restart with python test-app.py, I get the scatter plot again (current contents of my file). When I undid my delete/paste to get back to the components example and saved, I did not get the terminal output about Restarting with stat because the first app launched didn’t enable the debugger. Refreshing the page still shows the scatter plot, even though the file now contains the component example. In this case dash is not “watching” and you’ll have to kill the process and restart to show changes.

Hope something in there is useful!