Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I use Socket.IO with Django? [closed]

Is there any way to use Socket.IO http://socket.io/ with Django?

like image 644
User Avatar asked Nov 16 '10 00:11

User


People also ask

How do I use 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.

What is Socket.IO Django?

A Django app providing the features required to use websockets with Django via Socket.IO.

Is Socket.IO better than WebSocket?

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.


1 Answers

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)

like image 78
23Critters Avatar answered Sep 30 '22 20:09

23Critters