Is there any python module for sending messages between users in a web application?

I am using a pyramid to create a website and would like to find several modules for sending messages between user accounts on my website. I heard that rails have some gems, such as https://github.com/ging/mailboxer or https://github.com/pluginaweek/has_messages .

I would like to find python. Can someone recommend me some python modules? Thanks!

+1
source share
2 answers

You are probably best off using an existing protocol like XMPP . For example, for Plone (Python CMS), there is full XMPP integration with collective.xmpp.chat , which provides multi-user chat and instant messaging between authenticated users of the Plone website ( demo video ).

For Pyramid, you need to complete this integration yourself [1] by starting the Jabber / XMPP server (eg ejabberd ) and using the existing XMPP client library to communicate with Python. There are many XMPP libraries for Python, some of which are described in the answers to this question .

Note Don't be afraid if it looks complicated after watching XMPP. XMPP and its extension describe a wide range of features related to Messaging and Presence, chat is just one of them. If you do not need other functions, just do not execute them in your web application.

[1] There is actually a Pyramid project that seems to be doing just that: seshat , written by @KirkStrauser. I have not used it myself, but it looks very promising.

+4
source

No; direct communication between two people is not possible in web applications because they use stateless protocols; the server does not know whether the request comes from the same person or not.

In this case, as a rule, chat applications usually store messages in a database between two people and use AJAX to retrieve them.

There are already many chat tutorials and third-party chat applications on the Internet; you can check them out.

-1
source

All Articles