如何在django中建立推送系统? [英] How to build a push system in django?

查看:155
本文介绍了如何在django中建立推送系统?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在django中构建推送系统,其基本功能是将消息从服​​务器推送到浏览器。

I need to build a push system in django, basicly its function is to push messages from server to browser.

由于nodejs不能使用,我更喜欢websocket或轨道,但我不知道如何在django中实现这两个。请为我推荐一种方法,这将帮助我很多,thx。

As nodejs cannot be used, i prefer websocket or orbited, but i've no idea how to implement any of these two in django. pls recommend a method for me, this will help me a lot, thx.

推荐答案

Django不善于把事情推送给客户。如果django是您唯一的选择,则模拟推送的唯一方式是通过长轮询。但这并不有效。相反,websockets是热的。龙卷风和扭曲可以帮助你在这里。 此处还有一个更完整的答案。

Django isn't good at "pushing" things to the client. If django is your only option, the only way to mimic a push is via long-polling. But this is not efficient. Instead, websockets are hot. Tornado and twisted can help you here. There is also a more complete answer to your question here.

这篇关于如何在django中建立推送系统?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆