我可以在 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 本身不是异步的,所以你必须与普通的 django 服务器并行使用 Socket.IO 服务器,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屋!