Django stuck after doing code change (hot reload)

Hello folks,

I upgraded my Django version from 3.2.15 to 4.2.1 and also my Python version from 3.7.13 to 3.11.0 and the hot reload of my Django project stopped working.

The server starts as expected with the pipenv run python src/manage.py runserver {host}:{port} command, but when I do a code change and save it gets stuck saying:

[INFO] [django]: /my-route/my-file.py changed, reloading

When I had my old dependencies, after saving a file the server just reloaded and it showed the changes.

I tried to set the verbosity to 3, but I can’t get any information explaining the error and I don’t know how to debug it. It looks like it uses StatReloader to detect this file changes:

[INFO] [django]: Watching for file changes with StatReloader gets printed before starting the server.

I would really appreciate it if you can give me some help about this topic.

Thanks in advance!

1 Like

A weried problem.When I debug in windows env,it works.But in debian os ,it occurs like above.Then,I try to debug in source code finding that the subProcess used to start true django web app can’t be captured by debugger.It seems like that it lose relation with main listen process.But in windows os,It can be captured so that the main process can continue to debug and get its return code