First item is that gunicorn isn’t going to handle websocket connection upgrades. Your /ws/
url should be forwarding to a Daphne / uvicorn / asgi service. Your gunicorn instance should be handling wsgi
only.
Also, if you’re separating the handling of those two, there are usually changes that need to be made to the asgi.py
file for that. Please post that file.
Second, depending upon the rest of your configuration, this setting is probably not going to handle traffic to your site. (Unless you’re the owner of mydomain.com
, which I kind of doubt.)
You might want to see the thread at Django Websockets deployment issue for a more complete example of a functional environment. (There are other threads here as well showing working configurations.)