Open jotauses opened 6 years ago
there are so many different ways uWSGI is compiled. For instance the logger can be statically linked or is available as a 3rd party module. Presumably the latter is your problem.
I had to put os.environ.setdefault("DJANGO_SETTINGS_MODULE", "my_app.settings")
before django_setup()
in wsgi_server.py
Now the socket connects but I get this error and the message does not send:
`Traceback (most recent call last): File "/home/ubuntu/deploy/bbrainers/venv/lib/python3.6/site-packages/django_websocket_redis-0.5.2-py3.6.egg/ws4redis/wsgi_server.py", line 131, in call recvmsg = RedisMessage(websocket.receive()) File "/home/ubuntu/deploy/bbrainers/venv/lib/python3.6/site-packages/django_websocket_redis-0.5.2-py3.6.egg/ws4redis/uwsgi_runserver.py", line 31, in receive raise WebSocketError(e) ws4redis.exceptions.WebSocketError: unable to receive websocket message [pid: 25855|app: 0|req: 2/4] 127.0.0.1 () {44 vars in 987 bytes} [Mon Jul 30 11:53:24 2018] GET /ws/notify?subscribe-broadcast/ => generated 38 bytes in 10736 msecs (HTTP/1.1 101) 4 headers in 184 bytes (3 switches on core 999) WebSocketError: unable to receive websocket message Traceback (most recent call last): File "/home/ubuntu/deploy/bbrainers/venv/lib/python3.6/site-packages/django_websocket_redis-0.5.2-py3.6.egg/ws4redis/uwsgi_runserver.py", line 28, in receive return uwsgi.websocket_recv_nb() OSError: unable to receive websocket message
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/home/ubuntu/deploy/bbrainers/venv/lib/python3.6/site-packages/django_websocket_redis-0.5.2-py3.6.egg/ws4redis/wsgi_server.py", line 131, in call recvmsg = RedisMessage(websocket.receive()) File "/home/ubuntu/deploy/bbrainers/venv/lib/python3.6/site-packages/django_websocket_redis-0.5.2-py3.6.egg/ws4redis/uwsgi_runserver.py", line 31, in receive raise WebSocketError(e) ws4redis.exceptions.WebSocketError: unable to receive websocket message [pid: 25856|app: 0|req: 3/5] 127.0.0.1 () {44 vars in 987 bytes} [Mon Jul 30 11:53:35 2018] GET /ws/notify?subscribe-broadcast/ => generated 20 bytes in 3097 msecs (HTTP/1.1 101) 4 headers in 184 bytes (3 switches on core 998)`
Any solution?
When I run the command in the docs:
uwsgi --virtualenv /path/to/virtualenv --http-socket /path/to/web.socket --gevent 1000 --http-websockets --workers=2 --master --module wsgi_websocket
I get the next error: