May-09-2017, 11:18 AM
May-09-2017, 06:17 PM
socket.io is two different things with the same name. There's a javascript library which uses websockets if available, and falls back to long polling if it isn't available. Then there's a node.js library which is just a websocket server. So you could look for a "socket.io" package for django... or you could look for a django websocket library.
As it turns out, django has an official websocket library called "channels": https://github.com/django/channels/
Instead of figuring out how to butcher socket.io to work with django, you'd probably have a much more enjoyable time using channels instead.
As it turns out, django has an official websocket library called "channels": https://github.com/django/channels/
Instead of figuring out how to butcher socket.io to work with django, you'd probably have a much more enjoyable time using channels instead.