This is the problem I encountered on all of my sites running Django 1.7 in mod_wsgi. The problem is that if, developing locally, I introduce a fatal error into the code base and then fix it, monitoring the script code does not detect a correction.
I use the Graham Dumpleton monitor.py script to detect changes in the codebase when I develop locally (I use apache, not the Django development server).
It always worked in Django <= 1.6, but in Django 1.7 I get the following error:
File "/home/me/.virtualenvs/myvirtualenv/lib/python2.7/site-packages/django/core/wsgi.py", line 14, in get_wsgi_application django.setup() File "/home/me/virtualenvs/myvirtualenv/lib/python2.7/site-packages/django/__init__.py", line 21, in setup apps.populate(settings.INSTALLED_APPS) File "/home/me/.virtualenvs/myvirtualenv/lib/python2.7/site-packages/django/apps/registry.py", line 78, in populate raise RuntimeError("populate() isn't reentrant") RuntimeError: populate() isn't reentrant
It is annoying that if I fix the error, monitor.py will not detect the change, so I must either restart apache or touch another file that has already been downloaded (for example, a settings file).
I think this is because "the reboot code only tracks imported files (aka sys.modules)" ( source ). Since the wrong file was not successfully imported, monitor.py does not know to restart the process.
django apache mod-wsgi
seddonym Dec 01 '14 at 16:26 2014-12-01 16:26
source share