Я вижу следующее в моих журналах, и мой сайт не загружается, когда я посещаю его. Может кто-нибудь сказать мне, как я могу это исправить? Target WSGI script '/svr/myproject/myproject/wsgi.py' cannot be loaded as Python module.
RuntimeError: populate() isn't reentrant
[Mon Mar 30 00:09:55.290149 2020] [wsgi:error] [pid 19620] [...] mod_wsgi (pid=19620): Target WSGI script '/svr/myproject/myproject/wsgi.py' cannot be loaded as Python module.
[Mon Mar 30 00:09:55.290192 2020] [wsgi:error] [pid 19620] [...] mod_wsgi (pid=19620): Exception occurred processing WSGI script '/svr/myproject/myproject/wsgi.py'.
[Mon Mar 30 00:09:55.290211 2020] [wsgi:error] [pid 19620] [...] Traceback (most recent call last):
[Mon Mar 30 00:09:55.290231 2020] [wsgi:error] [pid 19620] [...] File "/svr/myproject/myproject/wsgi.py", line 16, in <module>
[Mon Mar 30 00:09:55.290270 2020] [wsgi:error] [pid 19620] [...] application = get_wsgi_application()
[Mon Mar 30 00:09:55.290279 2020] [wsgi:error] [pid 19620] [...] File "/usr/local/lib/python2.7/dist-packages/django/core/wsgi.py", line 13, in get_wsgi_application
[Mon Mar 30 00:09:55.290294 2020] [wsgi:error] [pid 19620] [...] django.setup(set_prefix=False)
[Mon Mar 30 00:09:55.290302 2020] [wsgi:error] [pid 19620] [...] File "/usr/local/lib/python2.7/dist-packages/django/__init__.py", line 27, in setup
[Mon Mar 30 00:09:55.290313 2020] [wsgi:error] [pid 19620] [...] apps.populate(settings.INSTALLED_APPS)
[Mon Mar 30 00:09:55.290320 2020] [wsgi:error] [pid 19620] [...] File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py", line 78, in populate
[Mon Mar 30 00:09:55.290332 2020] [wsgi:error] [pid 19620] [...] raise RuntimeError("populate() isn't reentrant")
[Mon Mar 30 00:09:55.290348 2020] [wsgi:error] [pid 19620] [...] RuntimeError: populate() isn't reentrant
/ svr / myproject / myproject / wsgi.py
"""
WSGI config for myproject project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myproject.settings')
application = get_wsgi_application()
/ etc / apache2 / sites- enabled / myproject.conf
<VirtualHost *:80>
ServerName myproject.ca
ErrorLog ${APACHE_LOG_DIR}/myproject-error.log
CustomLog ${APACHE_LOG_DIR}/myproject-access.log combined
WSGIApplicationGroup %{GLOBAL}
WSGIDaemonProcess myproject processes=2 threads=25 python-path=/svr/myproject
WSGIProcessGroup myproject
WSGIScriptAlias / /svr/myproject/myproject/wsgi.py
Alias /robots.txt /svr/myproject/static/robots.txt
Alias /favicon.ico /svr/myproject/static/favicon.ico
Alias /static /svr/myproject/static/
Alias /media /svr/myproject/media/
<Directory /svr/myproject/myproject>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
<Directory /svr/myproject/static>
Require all granted
</Directory>
<Directory /svr/myproject/media>
Require all granted
</Directory>
</VirtualHost>