Search code examples
pythondjangowebsocketsocket.iotornado

websocket server for django application


I have a django application need to be deployed under Apache HTTP Server, also i need push event to client's web browser at real time. I'm rather new to python, could anyone suggest some websocket server could work in Python+Django+Apache?


Solution

  • Django is a synchronous web server. it means you cannot use websocket directly with it. But you have various option to do websocket in Django.

    Use a full python stack to do it: use Tornado and Django. You can follow this post

    Use Nodejs + socket.io + message broker : Follow this type of tutorial

    You will find more resources to help you doing that with node.js & socket.io than using tornado.