django-magiclink
Passwordless authentication for Django with Magic Links
What it is and what it does
django-magiclink is a Django authentication backend that replaces traditional password-based login with email-delivered magic links. Users request a login link by entering their email, receive a single-use token via email, and clicking the link logs them in automatically. The package handles token generation, validation, expiration, and optional constraints like same-browser or same-IP requirements.
Setup involves adding the app to INSTALLED_APPS, configuring URLs and authentication backends, running migrations, and customizing login templates. The package provides sensible defaults for token security, email styling, and error handling, with configuration options for signup requirements, token reuse policies, and superuser/staff login restrictions.
Use it for:
- Replace password-based login in Django apps with email-based authentication to reduce password management burden
- Implement frictionless signup flows where users create accounts by email alone without choosing passwords
- Add passwordless login as an alternative authentication method alongside existing password backends
- Build security-conscious applications where token expiry, IP binding, and browser locking reduce account compromise risk
- Customize login and email templates to match application branding while keeping authentication logic secure
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Adds passwordless email-based authentication to Django applications using single-use magic links instead of passwords.
Yes, if you are running a Django project on a compatible version and want to add passwordless email authentication with minimal setup. The low install friction, MIT license, and 100% test coverage make it a reasonable choice. However, verify compatibility with your Django version first—the last release was 2023-07-13 and maintenance is dormant, so test thoroughly before deploying to production.
Install
django-magiclink on PyPI
pip
pip install django-magiclinkuv
uv add django-magiclinkpoetry
poetry add django-magiclinkInstalling django-magiclink
Before you install
Low install friction with only Django and packaging as runtime dependencies. Maintenance is dormant—last release was 2023-07-13, over a year ago, though the repository remains active with no archived status.
License in practice
MIT license permits free use, modification, and distribution with minimal restrictions, making it suitable for both open-source and commercial projects.
Quickstart
pip install django-magiclink
# In settings.py:
INSTALLED_APPS = [..., 'magiclink']
AUTHENTICATION_BACKENDS = ('magiclink.backends.MagicLinkBackend', ...)
LOGIN_URL = 'magiclink:login'
# In urls.py:
path('auth/', include('magiclink.urls', namespace='magiclink'))
# Then run:
python manage.py migrate magiclink
Requires Django and Python 3.6+; you must create custom login and email templates to match your application's design.
Verify before relying
- Whether the package works with Django versions released after 2023-07-13
- Current compatibility with modern Django LTS versions
- Whether dormant status indicates the package is stable or no longer maintained
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.6,<4.0) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — Django, packaging |
| Maintenance | dormant — 1,128 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 108,283/month — #12,564 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: django_magiclink-1.3.0-py3-none-any.whl
Keywords: magic link, authentication, passwordless
Tags
More Dynamic Content packages
MarkupSafe provides a text object that escapes…
permissive · top 100 on PyPI
Jinja2Jinja2 is a templating engine that renders…
permissive · top 100 on PyPI
soupsieveSoupsieve is a CSS selector library designed to…
permissive · top 100 on PyPI
WerkzeugWerkzeug is a WSGI utility library providing…
permissive · top 1,000 on PyPI
FlaskFlask is a lightweight WSGI web application…
permissive · top 1,000 on PyPI
MakoMako compiles Python-embedded templates into…
permissive · top 1,000 on PyPI
django-sesamedjango-sesame provides token-based…
permissive · top 15,000 on PyPI
django-authlibProvides passwordless authentication for Django…
permissive · top 15,000 on PyPI
stytchA Python client library for integrating…
permissive · top 5,000 on PyPI
django-otp-webauthnAdds WebAuthn Passkey support to Django OTP,…
permissive · top 15,000 on PyPI
django-allauthProvides integrated local and social…
permissive · top 5,000 on PyPI
django-auth-adfsIntegrates Django applications with Microsoft…
permissive · top 15,000 on PyPI
dj-rest-authProvides drop-in REST API endpoints for user…
permissive · top 5,000 on PyPI
soft-webauthnEmulates a WebAuthn authenticator in Python for…
permissive · top 15,000 on PyPI
django-defenderBlocks brute-force login attempts in Django by…
permissive · top 15,000 on PyPI
django-impersonateAllows Django superusers to temporarily assume…
permissive · top 15,000 on PyPI