是否有任何 python 模块用于在 Web 应用程序中的用户之间发送消息? [英] Is there any python module for sending messages between users in a web application?

查看:43
本文介绍了是否有任何 python 模块用于在 Web 应用程序中的用户之间发送消息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用金字塔来建立一个网站,并想找到一些关于在我的网站中的用户帐户之间发送消息的模块.我听说 Rails 有一些这样的宝石,比如 https://github.com/ging/mailboxerhttps://github.com/pluginaweek/has_messages.

I'm using pyramid to build up a web site and would like to find some modules about sending messages between users accounts in my web site. I've heard that rails has some gems for that such like https://github.com/ging/mailboxer or https://github.com/pluginaweek/has_messages .

我想找到蟒蛇.谁能推荐我一些python模块?谢谢!

I would like to find the python one. Can anyone recommend me some python modules? Thanks!

推荐答案

您可能最好使用现有的协议,例如 XMPP.例如,对于 Plone(一个 Python CMS),有一个完整的 XMPP 集成与 collective.xmpp.chat 在 Plone 站点的经过身份验证的用户之间提供多用户聊天和即时消息(演示视频a>).

You're probably best off using an existing protocol like XMPP. For Plone (a Python CMS) for example there's a complete XMPP integration with collective.xmpp.chat providing multi-user chat and Instant Messaging between authenticated users of a Plone site (demo video).

对于 Pyramid,您需要通过运行 Jabber/XMPP 服务器(例如 ejabberd) 并使用 Python 的现有 XMPP 客户端库与其通信.Python 有很多 XMPP 库,其中一些在 这个问题的答案中有所描述.

For Pyramid you'll need to do this integration yourself [1], by running a Jabber / XMPP server (such as ejabberd) and using an existing XMPP client library for Python to communicate with it. There are plenty of XMPP libraries for Python, some of them are described in the answers to this question.

注意:如果在查看 XMPP 后它看起来方式复杂,请不要害怕.XMPP 及其扩展描述了与消息传递和在线状态相关的各种功能,聊天只是其中之一.如果您不需要其他功能,请不要在您的网络应用中实现它们.

Note: Don't be scared if after looking at XMPP it looks way to complex. XMPP and its extension describe a wide variety of features related to Messaging and Presence, chat is just one of them. If you don't need the other features, simply don't implement them in your webapp.

[1] 实际上,有一个 Pyramid 项目似乎就是这样做的:seshat,由@KirkStrauser 编写.我自己没用过,不过看起来很有前途.

[1] Actually, there is a Pyramid project that seems to do exactly that: seshat, written by @KirkStrauser. I haven't used it myself, but it looks very promising.

这篇关于是否有任何 python 模块用于在 Web 应用程序中的用户之间发送消息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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