Django-tornado-websockets is actually in alpha version!
To use django-tornado-websockets’s WebSockets, you should use Tornado as a WSGI server where you will define
handlers to handle an incoming request. Since we already have a WSGI server, it’s probably useless to try running
Gunicorn or uWSGI as WSGI server.
You can try to wrap Tornado WSGI server into Gunicorn/uWSGI WSGI server but... It’s a bit retarded I think
Let’s explain this diagram:
- The client make a request to our web server with his web browser,
- Our web server (nginx, Apache, ...) pass this WSGI or WebSocket request to Tornado ,
- If it is a WebSocket request, we pass it to
tornado.websocket, otherwise it’s Django that will handle this request,
- We wait for a WebSocket response or a Django response,
- and 6. Then we return this response to the client.
|||I forgot it on the diagram, but nginx or Apache has the job to deliver static files, it’s not Tornado’s work|
- 1. Installation
- 2. Django integration and configuration
- 3. Usage
- 3.1. Run Tornado server
- 3.2. Using WebSockets (server side)
- 3.3. Using WebSockets (client side)
- 4. Modules
- 5. API