Skip to main content

Login to your Django app with a link sent by email.

Project description

django-passwordless-login

Test and build PyPI version shields.io PyPI status PyPI pyversions PyPI license

Login to your Django app with a link sent by email.

Adding it to your django project

  1. Install django-passwordless-login:
$ pip install django-passwordless-login
  1. Add "passwordless_login.apps.PasswordlessLoginConfig" to INSTALLED_APPS:
INSTALLED_APPS += ["passwordless_login.apps.PasswordlessLoginConfig"]
  1. Write a login template and specify the path in settings, ie:
LOGIN_TEMPLATE_PATH = "app_name/login.html"
  1. Include "passwordless_login/login.html" in the template where users will login:
{% include "passwordless_login/login.html" %}
  1. Include functionality of the login view directly from passwordless_login.views import login, or include the urls from this app into your app's urlpatterns:
include("passwordless_login.urls")

Customisable Settings include:

  • LOGIN_MAX_AGE - A datetime.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 (default True)
  • 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 to link (required), minutes (equivalent to LOGIN_MAX_AGE), app_name, and contact_email.
  • APP_NAME - used in the default email content
  • LOGIN_CONTACT_EMAIL - used in the default email content
  • LOGIN_FROM_EMAIL - used as the from email if desired to be different from the standard Django DEFAULT_FROM_EMAIL

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-passwordless-login-0.0.3.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_passwordless_login-0.0.3-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file django-passwordless-login-0.0.3.tar.gz.

File metadata

File hashes

Hashes for django-passwordless-login-0.0.3.tar.gz
Algorithm Hash digest
SHA256 56797fee6902c8fac62d6974248b78539932d3bc47c2600a58906e37b0cf28c9
MD5 b331979e8a0581cf8d89a7f62fb53aef
BLAKE2b-256 65b7fdc9bfd25c9b025c1e4341e3bf5fe43ed77767b6c1d28226866ba403f589

See more details on using hashes here.

File details

Details for the file django_passwordless_login-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for django_passwordless_login-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 42d841cdcae2a8f677b42066e8a81f0818d129cf310ff707056b91abc3dbf1fd
MD5 ec39aacf59dd3858cc8d7da6f3c1e40d
BLAKE2b-256 945b8a9d8f2594a608c1a630e3411656fd149e530bfd35b91102957d8a80a953

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page