Django与Ajax轮询聊天 [英] Django chat with ajax polling
本文介绍了Django与Ajax轮询聊天的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要创建类似于Facebook聊天的聊天.
I need to create a chat similar to facebook chat.
我正在考虑创建一个简单的应用程序Chat,然后使用ajax轮询(每2-3秒发送一次请求).
I am thinking to create a simple application Chat and then using ajax polling ( to send request every 2-3 seconds ).
这是一个好方法吗?
推荐答案
我会处理一些涉及服务器控制的推送/实时消息传递的事情.您将获得适当的实时聊天,并且扩展性会更好.我认为,可以看看 http://www.orbited.org/.它不是django的核心,但它是Python,可以很好地与服务器上的Django应用一起使用
I'd go with something that involves push/real-time messaging controlled by the server. You'll get proper real-time chat and it will scale a lot better. Take a look at http://www.orbited.org/ which is the way to go, I reckon. It's not core django, but it's Python and will sit well alongside a Django app on your server
这篇关于Django与Ajax轮询聊天的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文