ошибка django wsgi не найден модуль с именем сайта - PullRequest
0 голосов
/ 14 ноября 2018

Когда я запускаю команду uwsgi --http :8081 --gevent 100 --module websocket --gevent-monkey-patch --master -H env/ Я получаю ошибку Приложение Python не найдено и когда я указываю путь к файлу wsgi.py, uwsgi --http: 8081 --gevent 100 --modulewebsocket --gevent-monkey-patch --master -H env / --wsgi-file / Users / ishansrivastava / Desktop / ChatApp / Chatire / chatire / wsgi.py`, я получаю

ModuleNotFoundError: No module named 'chatire'
DAMN ! worker 1 (pid: 77847) died :( trying respawn ...
Respawned uWSGI worker 1 (new pid: 77851)
*** running gevent loop engine [addr:0x104312c00] ***
Traceback (most recent call last):
  File "/Users/ishansrivastava/Desktop/ChatApp/env/lib/python3.6/site-packages/gevent/monkey.py", line 611, in patch_all
    patch_thread(Event=Event, _warnings=_warnings)
  File "/Users/ishansrivastava/Desktop/ChatApp/env/lib/python3.6/site-packages/gevent/monkey.py", line 348, in patch_thread
    _patch_existing_locks(threading_mod)
  File "/Users/ishansrivastava/Desktop/ChatApp/env/lib/python3.6/site-packages/gevent/monkey.py", line 263, in _patch_existing_locks
    if isinstance(o, rlock_type):
  File "/Users/ishansrivastava/Desktop/ChatApp/env/lib/python3.6/site-packages/django/utils/functional.py", line 215, in inner
    self._setup()
  File "/Users/ishansrivastava/Desktop/ChatApp/env/lib/python3.6/site-packages/django/conf/__init__.py", line 43, in _setup
    self._wrapped = Settings(settings_module)
  File "/Users/ishansrivastava/Desktop/ChatApp/env/lib/python3.6/site-packages/django/conf/__init__.py", line 106, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/Users/ishansrivastava/Desktop/ChatApp/env/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 978, in _gcd_import
  File "<frozen importlib._bootstrap>", line 961, in _find_and_load
  File "<frozen importlib._bootstrap>", line 936, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 978, in _gcd_import
  File "<frozen importlib._bootstrap>", line 961, in _find_and_load
  File "<frozen importlib._bootstrap>", line 948, in _find_and_load_unlocked

КогдаЯ захожу в каталог chatire и снова запускаю ту же команду, получаю

OSError: unable to complete websocket handshake
[pid: 79930|app: 0|req: 1/1] 127.0.0.1 () {46 vars in 789 bytes} [Wed Nov 14 16:13:37 2018] GET /475ae83b85db4d0 => generated 0 bytes in 67 msecs (HTTP/1.1 500) 0 headers in 0 bytes (1 switches on core 99)
you need to build uWSGI with SSL support to use the websocket handshake api function !!!
Traceback (most recent call last):
  File "./websocket.py", line 30, in application
    env.get('HTTP_ORIGIN', '')
OSError: unable to complete websocket handshake
[pid: 79930|app: 0|req: 2/2] 127.0.0.1 () {46 vars in 789 bytes} [Wed Nov 14 16:13:46 2018] GET /475ae83b85db4d0 => generated 0 bytes in 19 msecs (HTTP/1.1 500) 0 headers in 0 bytes (1 switches on core 99)
you need to build uWSGI with SSL support to use the websocket handshake api function !!!
Traceback (most recent call last):
  File "./websocket.py", line 30, in application
    env.get('HTTP_ORIGIN', '')
OSError: unable to complete websocket handshake
[pid: 79930|app: 0|req: 3/3] 127.0.0.1 () {46 vars in 789 bytes} [Wed Nov 14 16:13:54 2018] GET /475ae83b85db4d0 => generated 0 bytes in 25 msecs (HTTP/1.1 500) 0 headers in 0 bytes (1 switches on core 99)
^CSIGINT/SIGQUIT received...killing workers...
Brutally killing worker 1 (pid: 79930)...
Wed Nov 14 16:14:00 2018 - stopping gevent signals watchers for worker 1 (pid: 79930)...
gateway "uWSGI http 1" has been buried (pid: 79932)
Wed Nov 14 16:14:00 2018 - stopping gevent sockets watchers for worker 1 (pid: 79930)...
Wed Nov 14 16:14:00 2018 - main gevent watchers stopped for worker 1 (pid: 79930)...

1 Ответ

0 голосов
/ 14 ноября 2018

попробуйте эту команду в корневой папке:

uwsgi --http :8081 --gevent 100 --module websocket --gevent-monkey-patch --master

В корневой папке должен быть модуль под названием websocket.py.

Если вы используете virtualenv, убедитесь, что он активирован и все зависимости установлены.

...