Скрипт WSGI не может быть загружен как модуль Python: сервер Django с Apache - PullRequest
0 голосов
/ 23 марта 2019

Я настраиваю новый сервер с использованием Apache и Django, но у меня возникают проблемы с WSGI при попытке доступа к серверу.

Это журнал apache:

[Sat Mar 23 09:13:35.367639 2019] [wsgi:error] [pid 19535:tid 140663217088256] [client 139.47.79.250:8469] mod_wsgi (pid=19535): Target WSGI script '/root/frontend/frontend/wsgi.py' cannot be loaded as Python module.
[Sat Mar 23 09:13:35.367773 2019] [wsgi:error] [pid 19535:tid 140663217088256] [client 139.47.79.250:8469] mod_wsgi (pid=19535): Exception occurred processing WSGI script '/root/frontend/frontend/wsgi.py'.
[Sat Mar 23 09:13:35.367999 2019] [wsgi:error] [pid 19535:tid 140663217088256] [client 139.47.79.250:8469] Traceback (most recent call last):
[Sat Mar 23 09:13:35.368076 2019] [wsgi:error] [pid 19535:tid 140663217088256] [client 139.47.79.250:8469]   File "/root/frontend/frontend/wsgi.py", line 16, in <module>
[Sat Mar 23 09:13:35.368098 2019] [wsgi:error] [pid 19535:tid 140663217088256] [client 139.47.79.250:8469]     application = get_wsgi_application()
[Sat Mar 23 09:13:35.368127 2019] [wsgi:error] [pid 19535:tid 140663217088256] [client 139.47.79.250:8469]   File "/usr/local/lib/python3.5/dist-packages/django/core/wsgi.py", line 12, in get_wsgi_application
[Sat Mar 23 09:13:35.368145 2019] [wsgi:error] [pid 19535:tid 140663217088256] [client 139.47.79.250:8469]     django.setup(set_prefix=False)
[Sat Mar 23 09:13:35.368164 2019] [wsgi:error] [pid 19535:tid 140663217088256] [client 139.47.79.250:8469]   File "/usr/local/lib/python3.5/dist-packages/django/__init__.py", line 19, in setup
[Sat Mar 23 09:13:35.368181 2019] [wsgi:error] [pid 19535:tid 140663217088256] [client 139.47.79.250:8469]     configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
[Sat Mar 23 09:13:35.368200 2019] [wsgi:error] [pid 19535:tid 140663217088256] [client 139.47.79.250:8469]   File "/usr/local/lib/python3.5/dist-packages/django/conf/__init__.py", line 57, in __getattr__
[Sat Mar 23 09:13:35.368216 2019] [wsgi:error] [pid 19535:tid 140663217088256] [client 139.47.79.250:8469]     self._setup(name)
[Sat Mar 23 09:13:35.368235 2019] [wsgi:error] [pid 19535:tid 140663217088256] [client 139.47.79.250:8469]   File "/usr/local/lib/python3.5/dist-packages/django/conf/__init__.py", line 44, in _setup
[Sat Mar 23 09:13:35.368251 2019] [wsgi:error] [pid 19535:tid 140663217088256] [client 139.47.79.250:8469]     self._wrapped = Settings(settings_module)
[Sat Mar 23 09:13:35.368270 2019] [wsgi:error] [pid 19535:tid 140663217088256] [client 139.47.79.250:8469]   File "/usr/local/lib/python3.5/dist-packages/django/conf/__init__.py", line 107, in __init__
[Sat Mar 23 09:13:35.368286 2019] [wsgi:error] [pid 19535:tid 140663217088256] [client 139.47.79.250:8469]     mod = importlib.import_module(self.SETTINGS_MODULE)
[Sat Mar 23 09:13:35.368305 2019] [wsgi:error] [pid 19535:tid 140663217088256] [client 139.47.79.250:8469]   File "/usr/lib/python3.5/importlib/__init__.py", line 126, in import_module
[Sat Mar 23 09:13:35.368321 2019] [wsgi:error] [pid 19535:tid 140663217088256] [client 139.47.79.250:8469]     return _bootstrap._gcd_import(name[level:], package, level)
[Sat Mar 23 09:13:35.368340 2019] [wsgi:error] [pid 19535:tid 140663217088256] [client 139.47.79.250:8469]   File "<frozen importlib._bootstrap>", line 986, in _gcd_import
[Sat Mar 23 09:13:35.368377 2019] [wsgi:error] [pid 19535:tid 140663217088256] [client 139.47.79.250:8469]   File "<frozen importlib._bootstrap>", line 969, in _find_and_load
[Sat Mar 23 09:13:35.368398 2019] [wsgi:error] [pid 19535:tid 140663217088256] [client 139.47.79.250:8469]   File "<frozen importlib._bootstrap>", line 944, in _find_and_load_unlocked
[Sat Mar 23 09:13:35.368418 2019] [wsgi:error] [pid 19535:tid 140663217088256] [client 139.47.79.250:8469]   File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
[Sat Mar 23 09:13:35.368438 2019] [wsgi:error] [pid 19535:tid 140663217088256] [client 139.47.79.250:8469]   File "<frozen importlib._bootstrap>", line 986, in _gcd_import
[Sat Mar 23 09:13:35.368458 2019] [wsgi:error] [pid 19535:tid 140663217088256] [client 139.47.79.250:8469]   File "<frozen importlib._bootstrap>", line 969, in _find_and_load
[Sat Mar 23 09:13:35.368478 2019] [wsgi:error] [pid 19535:tid 140663217088256] [client 139.47.79.250:8469]   File "<frozen importlib._bootstrap>", line 956, in _find_and_load_unlocked
[Sat Mar 23 09:13:35.368512 2019] [wsgi:error] [pid 19535:tid 140663217088256] [client 139.47.79.250:8469] ImportError: No module named 'frontend'
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...