开发者

Django chat with ajax polling

I need to create a chat simi开发者_如何学Pythonlar to facebook chat.

I am thinking to create a simple application Chat and then using ajax polling ( to send request every 2-3 seconds ).

Is this a good approach ?


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


ajax is the best here

what you will need: 1) server view that will return recent messages 2) client-side caller by timer (I prefer jQuery and its timers plugin) and success handler, that will populate the chat window

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜