Skip to content
This repository has been archived by the owner on May 5, 2020. It is now read-only.

Commit

Permalink
docs: Made it so the documentation has all of the settings' default v…
Browse files Browse the repository at this point in the history
…alues (#75)
  • Loading branch information
ataylor32 authored and relekang committed Dec 14, 2016
1 parent 0335845 commit 1623fec
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions docs/settings.rst
Expand Up @@ -8,32 +8,46 @@ django-nopassword settings

.. attribute:: NOPASSWORD_LOGIN_CODE_TIMEOUT

Default: ``900``

Defines how long a login code is valid in seconds.

.. attribute:: NOPASSWORD_NAMESPACE

Default: ``'nopassword'``

Defines the namespace for the urls, this must match the namespace of the include of
nopassword.urls. Default is 'nopassword'.
nopassword.urls.

.. attribute:: NOPASSWORD_HIDE_USERNAME

Default: ``False``

If set to True, the login url will not contain the username.

.. attribute:: NOPASSWORD_LOGIN_EMAIL_SUBJECT

Default: ``_('Login code')``

Sets Email Subject for Login Emails.

.. attribute:: NOPASSWORD_HASH_ALGORITHM

Default: ``'sha256'``

Set the algorithm for used in logincode generation. Possible values are those who are supported in hashlib. The value should be set as the name of the attribute in hashlib. Example `hashlib.sha256()` would be `NOPASSWORD_HASH_ALGORITHM = 'sha256'.

.. attribute:: NOPASSWORD_POST_REDIRECT

Default: ``True``

By default, the login code url requires a POST request to authenticate the user. A GET request renders ``registration/login_submit.html``, which contains some Javascript that automatically performs the POST on page load. To authenticate directly inside the initial GET request instead, set this to ``False``.

.. attribute:: NOPASSWORD_CODE_LENGTH

The length of the code used to log people in. Default is 20.
Default: ``20``

The length of the code used to log people in.

.. attribute:: NOPASSWORD_TWILIO_SID

Expand All @@ -45,14 +59,16 @@ django-nopassword settings

.. attribute:: NOPASSWORD_NUMERIC_CODES

A boolean flag if set to True, codes will contain numeric characters only (0-9). Default: False
Default: ``False``

A boolean flag if set to True, codes will contain numeric characters only (0-9).

Django settings used in django-nopassword
+++++++++++++++++++++++++++++++++++++++++

.. attribute:: SERVER_URL

Default: `example.com`
Default: ``'example.com'``

By default, ``nopassword.views.login`` passes the result of ``result.get_host()`` to
``LoginCode.send_login_code`` to build the login URL. If you write your own view
Expand All @@ -61,4 +77,4 @@ Django settings used in django-nopassword

.. attribute:: DEFAULT_FROM_EMAIL

Default: `root@example.com`
Default: ``'root@example.com'``

0 comments on commit 1623fec

Please sign in to comment.