Django populate () is not repetitive

I keep getting this when I try to download a Django application to production. I tried all the answers on stackoverflow but didn't fix anything. Any other ideas. (I am using Django 1.5.2 and Apache)

Traceback (most recent call last): File "/var/www/thehomeboard/wwwhome/wsgi.py", line 37, in <module> application = get_wsgi_application() File "/usr/local/lib/python2.7/dist-packages/django/core/wsgi.py", line 14, in get_wsgi_application django.setup() File "/usr/local/lib/python2.7/dist-packages/django/__init__.py", line 18, in setup apps.populate(settings.INSTALLED_APPS) File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py", line 78, in populate raise RuntimeError("populate() isn't reentrant") RuntimeError: populate() isn't reentrant 
+21
python django apache
Jun 20 '15 at 13:11
source share
3 answers

In the end, the problem was that I tried to run the second Django application and did not have the following in my apache configuration:

 WSGIDaemonProcess ... WSGIProcessGroup ... 

Just found out that you can run one django application without defining it, but when two of it give rise to a conflict.

+5
Jun 24 '15 at 13:10
source share

This RuntimeError first appeared for me after switching to Django 1.7 (and is still present with Django 1.8). This is usually caused by a Django application that causes an error, but this error is somehow swallowed.

Here is a workaround that works for me. Add it to your wsgi.py and the real error should be logged:

 import os import time import traceback import signal import sys from django.core.wsgi import get_wsgi_application try: application = get_wsgi_application() print 'WSGI without exception' except Exception: print 'handling WSGI exception' # Error loading applications if 'mod_wsgi' in sys.modules: traceback.print_exc() os.kill(os.getpid(), signal.SIGINT) time.sleep(2.5) 

See this thread in modwsgi for more details.

+21
Jun 21 '15 at 18:58
source share

The reason for the populate() isn't reentrant error populate() isn't reentrant be populate() isn't reentrant many reasons. If you look at registry.py in your django application, probably inside this directory
/python2.7/site-packages/django/apps

  # app_config should be pristine, otherwise the code below won't # guarantee that the order matches the order in INSTALLED_APPS. if self.app_configs: raise RuntimeError("populate() isn't reentrant") 

As you see in the comment, he says that app_config should be clean. This means that if one of the configurations is incorrect or if the library is not required, it will increase this populated error. I got this error because I skipped the sqlite installation. Even if you see that the exception does not mention possible reasons. I installed sqlite using this command on debian

 pip install pysqlite 

He solved my problem. My exception is due to the lack of pysqlite. Perhaps you are missing other necessary packages or errors in your settings.py

+3
Feb 16 '17 at 9:36 on
source share



All Articles