运行命令uwsgi --http :8081 --gevent 100 --module websocket --gevent-monkey-patch --master -H env/
时出现错误找不到python应用程序,并且当我指定wsgi.py
文件的路径时,uwsgi --http:8081- gevent 100 --module websocket --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)...
答案 0 :(得分:0)
在根文件夹中尝试此命令:
uwsgi --http :8081 --gevent 100 --module websocket --gevent-monkey-patch --master
在根文件夹中必须有一个名为websocket.py
的模块。
如果您使用的是virtualenv,请确保已将其激活并安装了所有依赖项。