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 https://github.com/ImperialCollegeLondon/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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c266859930f45b9f8425499d87603135ab1185dc6bde8f092d23962de4104a4 |
|
MD5 | 9d83b7d2d189641f16dc8db8c4cc6e0a |
|
BLAKE2b-256 | 4f845b4d127d3daf3b0d0df408e504b95a49a6213c3f5bc92e01f41f0d1acab2 |
Close
Hashes for django_passwordless_login-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 37bdacc736d655d38de1b6b287b97d93cdcd48f73f114892a20cc1cb4734b24b |
|
MD5 | 2e69d7e464c344e0f2d31daa2f0d78bf |
|
BLAKE2b-256 | 2796f28a4c64cadcecbe2d6c9279d3dce21b1b5348b975f6a19f53e004595372 |