简体   繁体   English

插入实时Django应用程序

[英]Socketing for a Real-Time Django Application

I'm trying to assess the advantages and disadvantages of implementing a Django application with real time capabilities with Socket.io versus Swamp Dragon. 我试图用Socket.io和Swamp Dragon来评估实现具有实时功能的Django应用程序的优缺点。 I understand that Socket has a much larger developer network and some good documentation, but that Swamp Dragon is built specifically for Django/is wrapped for Python. 我知道Socket有一个更大的开发人员网络和一些很好的文档,但Swamp Dragon专门为Django构建/包含在Python中。 I have no problem with more JS overhead in Socket's case, nonetheless. 尽管如此,我在Socket的情况下没有更多JS开销的问题。

Does anyone have experience with using either of these (preferably Socket 1.0 and Django 1.6 or higher)? 有没有人有使用其中任何一个的经验(最好是Socket 1.0和Django 1.6或更高版本)? Are there any resources you might be able to point me in the direction of? 您是否有任何资源可以指向我的方向? I'm aware of this Django module (which has a failing build and uses an old version of Socket), and articles like Max Burstein's . 我知道这个Django模块 (它有一个失败的构建并使用旧版本的Socket),以及像Max Burstein这样的文章。 Simply looking for a few more resources or possible frameworks to consider. 只需寻找更多资源或可能的框架来考虑。 Thanks. 谢谢。

After some research on this field. 经过对该领域的一些研究。 I decided to use swampdragon because as you said. 正如你所说,我决定使用swampdragon。 Is built specifically for Django and provides classes for publishing your models automatically. 专为Django构建,并提供自动发布模型的类。 Making some model to notify all users about its changes is really easy. 制作一些模型以通知所有用户有关其更改的信息非常简单。

The problem about the socketio package is that is outdated, using old version of socketio. 关于so​​cketio包的问题是过时的,使用旧版本的socketio。 Last month someone commented about some work being done. 上个月有人评论了一些正在完成的工作。 Check #19 . 检查#19

Another package that may worth mention is django-websocket-redis . 另一个值得一提的包是django-websocket-redis It has a working demo together with the django-angular package (from the same author). 它有一个工作演示和django-angular包(来自同一作者)。

But, as I said, I decided to use swampdragon because it is very easy to use it and because its work on integrating with django rest framework. 但是,正如我所说,我决定使用swampdragon,因为它很容易使用它,因为它的工作与django rest框架集成。

Hope it helps. 希望能帮助到你。

You can use django-omnibus . 你可以使用django-omnibus It uses SockJS which is really robust (perhaps more robust than SocketIO). 它使用SockJS,它非常强大(可能比SocketIO更强大)。 It also works with older browser. 它也适用于较旧的浏览器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM