我可以用Django使用Socket.IO吗? [英] Can I use Socket.IO with Django?
问题描述
有没有办法使用Django使用Socket.IO http://socket.io/ ?
Is there any way to use Socket.IO http://socket.io/ with Django?
推荐答案
确定可以!
Django本身不是同步的,所以你必须使用一个Socket.IO服务器与您的普通django服务器并行,node.js并不总是一个很好的选择,但存在其他用纯python编写的服务。
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.
这里是一个博客/使用gevent作为socket.io服务器的教程。
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/
对于具有更多历史的类似解决方案,您可以查看Orbited(www.orbited.org)
For a similar solution that has a bit more history you can look at Orbited, (www.orbited.org)
这篇关于我可以用Django使用Socket.IO吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!