Package: django-xmpp
XMPP integration for Django app made simple!Attention!This application is in early development stage. Every help or feedback is appreciated.FeaturesConverseJSweb chat integrationsurely best available XMPP web clientinspired byTracyWebTech/django-conversejsSupport for MUC auto joinSupport for users queryEjabberd Django authentication using ejabberd_auth management commandinspired byffalcinelli/django-ejabberd-bridgeSingle sign on functionality without storing user’s credentials
(requires using ejabberd_auth)Set avatar using gravatar and vCard during first loginInstallationInstalldjango-xmppvia pip:pip install django-xmppAddxmppanddjango_gravatarinto INSTALLED_APPS:INSTALLED_APPS = (
    ...
    'django_gravatar',
    'xmpp',
)Setup most important variables:XMPP_DOMAIN = 'example.com'
XMPP_BOSH_SERVICE_URL = 'https://xmpp.example.com:5280/http-bind'Optionally setup ConverseJS to suit your needs:XMPP_CONVERSEJS_SETTINGS = {
    'allow_contact_removal': False,
    'allow_contact_requests': True,
    'auto_subscribe': True,
    'allow_logout': False,
    'allow_muc': True,
    'allow_otr': False,
    'allow_registration': False,
    'message_carbons': True,
    'hide_muc_server': True,
    'use_vcards': True,
    'animate': True,
    'play_sounds': True,
    'xhr_user_search': True,
    'sounds_path': '%ssounds/' % STATIC_URL,
    'visible_toolbar_buttons': {
         'call': False,
         'clear': False,
         'emoticons': True,
         'toggle_participants': False,
    }
}Includexmpp.urlsin yoururls.py:urlpatterns = [
    ...
    url(r'^xmpp/', include("xmpp.urls")),
]Use ConverseJS in your base template:{% load xmpp_tags %}
{% conversejs_initialize %}Ejabberd Django authenticationCreateejaberd_auth.shfile that will simply callejabberd_authmanagement command. Adjust to suit your environment (eg. virtualenv):#!/bin/bash
cd <path_to_your_django_project>
python manage.py ejabberd_auth $@Edit ejabberd.yml and add external auth script, eg.:host_config:
    "example.com":
        auth_method: external
        extauth_program: "/<path_to_your_project>/ejabberd_auth.sh"SettingsThese are all available settings you may use.XMPP_BOSH_SERVICE_URLURL for ConverseJS BOSH connectionXMPP_DOMAINDefault XMPP domainXMPP_DOMAIN_MUCDomain for multi user chats (default converence.<XMPP_DOMAIN>)XMPP_CONVERSEJS_AUTHAuthentication type for ConverseJS (prebind is not
supported so login is the only option)XMPP_CONVERSEJS_SETTINGSdictionary of settings passed to converse.initialize.
For more list of available options seeConverse.js docsXMPP_ENABLEDEnable or disable XMPP at allXMPP_UPDATE_VCARDEnable or disable vCard updateXMPP_UPDATE_VCARD_HOURSUpdate vCard every n hours (default False)A note on usernamesJabber IDs are case-insensitive (so “MyUser@domain.com” and “myuser@domain.com” are the same account). By contrast, theusernamefield in the default DjangoUsermodel is case-sensitive (seethis Django ticket). This means two separate “MyUser” and “myuser” accounts in Django will have the same JID on the XMPP server. Theejabberd_authmanagement command will not authenticate such users, and they will both see “Authentication failed” in Converse and other XMPP clients.To avoid such conflicts, it is recommended to use a customUsermodel that enforces unique lowercase usernames with aRegexField. Other characters not allowed in a Jabber ID should be excluded as well. Seethis guidefor details.