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

Made it so the documentation has all of the settings' default values #75

Merged
merged 1 commit into from
Dec 14, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 21 additions & 5 deletions docs/settings.rst
Original file line number Diff line number Diff line change
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'``