websockets in django

65 views
Skip to first unread message

Rituparna Matkar

unread,
Aug 24, 2014, 1:53:02 PM8/24/14
to django...@googlegroups.com
Hi

I am trying to finish a phonegap app with django as a backend. I want to implement web sockets in this app. To give a use case, there are an array of buttons that all the users can see, if one user makes any changes to the button (enable/disables) the change should be visible to other users as well. The way I am coin it right now is after every 3 seconds I am sending a call to the server weather the status of the button has changed and if yes I refresh the page. I believe there could be a better solution to this. 

İsrafil KARA

unread,
Aug 24, 2014, 2:47:51 PM8/24/14
to django...@googlegroups.com

Hi, i think you use tornado. It's a simple way.

On Aug 24, 2014 4:56 PM, "Rituparna Matkar" <ritup...@gmail.com> wrote:
Hi

I am trying to finish a phonegap app with django as a backend. I want to implement web sockets in this app. To give a use case, there are an array of buttons that all the users can see, if one user makes any changes to the button (enable/disables) the change should be visible to other users as well. The way I am coin it right now is after every 3 seconds I am sending a call to the server weather the status of the button has changed and if yes I refresh the page. I believe there could be a better solution to this. 

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/fbbe58cd-8986-4197-8516-77c37ac8dd87%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Bill Freeman

unread,
Aug 25, 2014, 4:18:05 PM8/25/14
to django-users
+1 on tornado.  I may be behind the times, but I don't think that the Django architecture lends itself to persistent connections.  Also, Django is intended  to run behind another server, such as Apachi, nginx, etc., and that server, too, would need to be amenable to persistent connections.

This doesn't mean that you can't use Django as part of your solution, if other areas of the overall web site would benefit from it.  But you would want to direct your websockets connections to something that handles that well, such as tornado.


Avraham Serour

unread,
Aug 25, 2014, 4:21:43 PM8/25/14
to django...@googlegroups.com
it seems that uwsgi supports websockets, has anyone experimented with that?

using uwsgi is a fairly common and recommended way to deploy django, it would be nice to also use it for the ws part of the application, maybe memory savings or performance so I am curious about it but didn't have a chance to try  it yet.


Carlos Aguilar

unread,
Aug 25, 2014, 4:40:15 PM8/25/14
to django-users
gevent-socketio to use websockets with django app.

Best Regards



For more options, visit https://groups.google.com/d/optout.



--
Carlos Aguilar
Consultor Hardware y Software
DWD&Solutions
http://www.dwdandsolutions.com
Reply all
Reply to author
Forward
0 new messages