Skip to content

Commit 534889b

Browse files
committed
Adding docs for CONVERSEJS_AUTO_REGISTER
1 parent a46b491 commit 534889b

1 file changed

Lines changed: 28 additions & 3 deletions

File tree

README.rst

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Add ``conversejs`` to installed apps in your settings.py:
4343
Configure the BOSH service URL in your settings.py:
4444

4545
.. code-block:: python
46-
46+
4747
CONVERSEJS_BOSH_SERVICE_URL = 'https://my-bosh-service.com'
4848
4949
Load the static files in your templates using django-conversejs custom tags:
@@ -64,7 +64,7 @@ Load the chat panel and the Javascript initilizalizer also using our custom tags
6464

6565
{% load conversejs %}
6666
...
67-
67+
6868
{% conversejs_chatpanel %}
6969
{% conversejs_initialize %}
7070
</body>
@@ -90,6 +90,31 @@ Now everytime the select user your logs in your site he will be automaticaly log
9090
server using the credentials you provided.
9191

9292

93+
Enabling XMPP auto registration
94+
--------------------------------
95+
96+
By enabling auto registration ```django-conversejs``` will attempt to create a new
97+
XMPP account for every user that doesn't have one as soon as they login in your site.
98+
99+
To enable you just need to add the ```CONVERSEJS_AUTO_REGISTER``` option to your
100+
settings.py setting it to the domain of your XMPP service. Notice that the XMPP
101+
server and the BOSH service URL are two different things.
102+
103+
For example:
104+
105+
.. code-block:: python
106+
107+
CONVERSEJS_BOSH_SERVICE_URL = 'https://my-bosh-service.com'
108+
109+
CONVERSEJS_AUTO_REGISTER = 'xmpp.mycompany.com'
110+
111+
112+
In the example above Django will get the username from ```request.user.username``` and
113+
try to register under the xmpp domain ```xmpp.mycompany.com```, so if an user john logs in it would try to register ```john@xmpp.mycompany.com```.
114+
115+
If registration fails for any reason ```django-conversejs``` will attempt again on every request. That's something to be improved.
116+
117+
93118
Forms
94119
------
95120

@@ -121,7 +146,7 @@ django-conversejs depends of `pure-sasl`, a Python library to perform SASL authe
121146
Currently the stable version of pure-sasl has a bug which doesn't allow us to use
122147
DIGEST-MD5 authentication, which happens to be the most recommend authentication
123148
method. That's why this instructions ask you to install pure-sasl from a repository
124-
which is not the official one. As soon as `pure-sasl` authors get the bugs fixed
149+
which is not the official one. As soon as `pure-sasl` authors get the bugs fixed
125150
we'll update the instructions.
126151

127152
Sorry for the inconvenience.

0 commit comments

Comments
 (0)