From 1623fec64412334b760ee26d2806779305a8c471 Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 14 Dec 2016 00:25:55 -0700 Subject: [PATCH] docs: Made it so the documentation has all of the settings' default values (#75) --- docs/settings.rst | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/docs/settings.rst b/docs/settings.rst index 12172a3..05b529f 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -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 @@ -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 @@ -61,4 +77,4 @@ Django settings used in django-nopassword .. attribute:: DEFAULT_FROM_EMAIL - Default: `root@example.com` + Default: ``'root@example.com'``