Login to your Django app with a link sent by email.
Project description
django-passwordless-login
Login to your Django app with a link sent by email.
Adding it to your django project
- Install django-passwordless-login:
$ pip install django-passwordless-login
- Add
"passwordless_login.apps.PasswordlessLoginConfig"
toINSTALLED_APPS
:
INSTALLED_APPS += ["passwordless_login.apps.PasswordlessLoginConfig"]
- Write a login template and specify the path in settings, ie:
LOGIN_TEMPLATE_PATH = "app_name/login.html"
- Include
"passwordless_login/login.html"
in the template where users will login:
{% include "passwordless_login/login.html" %}
- Include functionality of the login view directly
from passwordless_login.views import login
, or include the urls from this app into your app'surlpatterns
:
include("passwordless_login.urls")
Customisable Settings include:
LOGIN_MAX_AGE
- Adatetime.timedelta
of the duration the login link will last (default 30 minutes)LOGIN_ONE_TIME
- If the login link can be used one time only (defaultTrue
)LOGIN_CREATE_NEW_USERS
- Boolean for whether or not this login form should create new users or just log in existing ones.LOGIN_EMAIL_CONTENT
- The content of the email, should include dynamic/format references tolink
(required),minutes
(equivalent toLOGIN_MAX_AGE
),app_name
, andcontact_email
.APP_NAME
- used in the default email contentLOGIN_CONTACT_EMAIL
- used in the default email contentDEFAULT_FROM_EMAIL
- used in the default email content
For development servers, change the EMAIL_BACKEND
setting to allow emails to be printed to the console:
EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for django-passwordless-login-0.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9a4f94608a74bbef853f1e993d9f07649801b1693727fe81fe507adcebdcb5d9 |
|
MD5 | 9286085e28c0478de1cdd5be243f44b5 |
|
BLAKE2b-256 | f58d48d2a53a8a5fc67f86b44c43cb1efbc18b8b2b1a13fe20fffb1c7d430e68 |
Close
Hashes for django_passwordless_login-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 87a4ef4e5b10fb51bf0d8268eda6ea66144e2d27951664a82cb3c42943a844d1 |
|
MD5 | d302e21d19f8ddee6ce97513c2d27820 |
|
BLAKE2b-256 | 0cdd22c0a4dc96ff9069a610f00dba540d3154c6b302b6f23dafe2218a40ff81 |