Django populate()不可重入

时间:2019-05-27 10:29:46

标签: python django populate

当我尝试在生产环境中加载Django应用程序时,我会不断得到这个信息。我尝试了所有stackoverflow答案,但没有任何解决方法。还有其他想法。 这是我的wsgi.py

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)

还有我得到的

[Mon May 27 18:09:41.654452 2019] [wsgi:error] [pid 15704:tid 1300] handling WSGI exception\r
[Mon May 27 18:09:41.655450 2019] [wsgi:error] [pid 15704:tid 1300] Traceback (most recent call last):\r
[Mon May 27 18:09:41.655450 2019] [wsgi:error] [pid 15704:tid 1300]   File "D:/soft_design/project_soft/project_soft/wsgi.py", line 26, in <module>\r
[Mon May 27 18:09:41.655450 2019] [wsgi:error] [pid 15704:tid 1300]     application = get_wsgi_application()\r
[Mon May 27 18:09:41.655450 2019] [wsgi:error] [pid 15704:tid 1300]   File "C:\\Users\\Scott\\Anaconda3\\envs\\py37\\lib\\site-packages\\django\\core\\wsgi.py", line 12, in get_wsgi_application\r
[Mon May 27 18:09:41.655450 2019] [wsgi:error] [pid 15704:tid 1300]     django.setup(set_prefix=False)\r
[Mon May 27 18:09:41.655450 2019] [wsgi:error] [pid 15704:tid 1300]   File "C:\\Users\\Scott\\Anaconda3\\envs\\py37\\lib\\site-packages\\django\\__init__.py", line 24, in setup\r
[Mon May 27 18:09:41.655450 2019] [wsgi:error] [pid 15704:tid 1300]     apps.populate(settings.INSTALLED_APPS)\r
[Mon May 27 18:09:41.655450 2019] [wsgi:error] [pid 15704:tid 1300]   File "C:\\Users\\Scott\\Anaconda3\\envs\\py37\\lib\\site-packages\\django\\apps\\registry.py", line 83, in populate\r
[Mon May 27 18:09:41.655450 2019] [wsgi:error] [pid 15704:tid 1300]     raise RuntimeError("populate() isn't reentrant")\r
[Mon May 27 18:09:41.655450 2019] [wsgi:error] [pid 15704:tid 1300] RuntimeError: populate() isn't reentrant\r
[Mon May 27 18:09:41.676394 2019] [mpm_winnt:crit] [pid 3488:tid 620] AH00427: Parent: child process 15704 exited with status 2 -- Aborting.

0 个答案:

没有答案