I've used django dev servers for years. I start them with
python manage.py runserver
and when I change any of the python code, they restart nicely.
Now I've inherited someone else's project for maintenance, and for whatever reason, I change the Python code and the server does not restart. I can't seem to find any kind of configuration option that would cause this.
I don't have the --noreload flag set, here's my proof:
$ ps -ef | grep runserver
chris 290898 250765 1 11:55 pts/6 00:00:00 python manage.py runserver
chris 290914 290898 5 11:55 pts/6 00:00:01 /home/chris/.virtualenvs/my-webapp-4cLYw-9X/bin/python manage.py runserver
Has anyone run into this before?
- Python 3.9.5
- Django 3.2.6
- using pipenv to manage my virtual environment
UPDATE
More info...equally as odd
the project is set up like this
src/manage.py
src/myproject (contains settings.py, urls.py, etc)
src/apps/app_one (contains models.py, tests.py, etc)
src/apps/app_two (contains models.py, tests.py, etc)
If I edit any file under src/myproject, then the server restarts as expected. But if I edit files under app_one or app_two, then the server does not restart.
UPDATE #2
Resurrecting this before it drives me crazy (it may be too late).
I added django.utils.autoreload': {'level': 'DEBUG'}, to settings.LOGGING, and now I can see that Django is watching my files, because I can see this in the logs:
[15/Feb/2022 10:58:14] django.utils.autoreload - DEBUG [tick:392] File /home/chris/OBFUSCATED/src/apps/account/models.py previous mtime: 1644940666.8954673, current mtime: 1644940693.9396086
[15/Feb/2022 10:58:14] django.utils.autoreload - DEBUG [notify_file_changed:366] /home/chris/OBFUSCATED/src/apps/account/models.py notified as changed. Signal results: [(<function template_changed at 0x7efd4b77b550>, True), (<function translation_file_changed at 0x7efd48257f70>, None)].
And yet, the dev server does not restart. Hoping this makes more sense to someone than it does to me.