6
votes

I am working on a web project, and I have to make a web chat. My structure is more or less like this: you have a username, password, nickname and email, and you can chat with other people who are in your roster. I am using django (python) for the web back-end, and xmpp for the chat part.

I have read a lot about xmpp, and I implemented a simple chat using stanzas, with adding and removal of contacts, nicknames, etc.

What I want to ask is how to communicate with django and ejabberd, for things like registering a user (I don't want in-band registration, I only want to enable registration when the user creates an account), changing passwords, updating nicknames, etc. Mostly things that need some kind of elevated privilege to do.

I did some research before posting here, I am aware of sleekxmp, but as far as I am concerned, it is just a python library for xmpp. Also, I didn't found an API for ejabberd.

Thank you.

2

2 Answers

0
votes

Read up on and using something like Workers to circumvent that. You don't want to naïvely use a sleek xmpp client in a view.

Since chat is full duplex, you probably want WebSocket + Django python WebService or Django / Comet (Push): Least of all evils? or even "oldskool" Long polling in Django

0
votes

By default, ejabberd uses internal users database, but you can setup ejabberd to manage users with external auth script - there are example scripts for integrating with Django app, with existing database, you can also write your own extauth script from scratch