Checking for code changes in all imported python modules

Almost every Python web infrastructure has a simple server that launches the wsgi application and automatically reloads the imported modules every time the source changes. I know that I can look at the code and see how this is done, but it can take some time, and I ask only out of curiosity. Does anyone know how this is implemented?

+1
source share
2 answers

As the author of one of the reload mechanisms (one in werkzeug), I can tell you that it does not work. What all the handlers do, expands once and restarts the child process if the monitor thread notices that one module has been changed in the file system.

Inline reload() ing , .

+2

reload() . "" .

"" () , twisted.python.rebuild .

+1

Source: https://habr.com/ru/post/1727736/


All Articles