Is there any way to use Socket.IO http://socket.io/ with Django?
Django with SocketIOCreate a socket app in Django project and add it to INSTALLED_APPS . Now inside socketio_app , edit views.py and add following code. Download views.py file from here. This code will create socket events for your applications.
A Django app providing the features required to use websockets with Django via Socket.IO.
Socket.IO is way more than just a layer above WebSockets, it has different semantics (marks messages with name), and does failovers to different protocols, as well has heartbeating mechanism. More to that attaches ID's to clients on server side, and more. So it is not just a wrapper, it is full-featured library.
Sure you can!
Django itself arent asyncronous so you have to use a Socket.IO server in parallel with your normal django server, node.js isnt always a good choice but there exists others written in pure python.
here is a blog/tutorial that uses gevent as socket.io server.
http://codysoyland.com/2011/feb/6/evented-django-part-one-socketio-and-gevent/
For a similar solution that has a bit more history you can look at Orbited, (www.orbited.org)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With