Skip to main content

django-stagedoor

Easy email or SMS based login for Django

Installation

  1. Add stagedoor to INSTALLED_APPS

    INSTALLED_APPS = [
        "django.contrib.admin",
        "django.contrib.auth",
        "django.contrib.contenttypes",
        "django.contrib.sessions",
        "django.contrib.messages",
        "django.contrib.staticfiles",
        "django.contrib.sites",
        "stagedoor",
        ...
    ]
    
  2. Add the authentication backends. Make sure to keep ModelBackend for the admin login

    AUTHENTICATION_BACKENDS = (
        "stagedoor.backends.EmailTokenBackend",
        "stagedoor.backends.SMSTokenBackend",
        "django.contrib.auth.backends.ModelBackend",
    )
    
  3. Add urls

    urlpatterns = [
        path("admin/", admin.site.urls),
        path("auth/", include("stagedoor.urls", namespace="stagedoor")),
       ...
    ]
    

Features

  • Email-based login with token links
  • SMS-based login with one-time codes (via Twilio)
  • Admin approval workflow (optional)
  • Single-use token support
  • Customizable templates and styling
  • Support for Django 5.2+
  • Management command to clean up stale tokens (python manage.py cleanup_stale_tokens)

Configuration

See stagedoor/settings.py for available configuration options.

Security Considerations

  • Tokens expire after a configurable duration (default: 30 minutes)
  • Rate limiting available (via optional django-ratelimit)
  • Tokens are generated using cryptographically secure randomness
  • Email and SMS delivery should be verified for security

Usage Examples

Cleanup stale tokens

python manage.py cleanup_stale_tokens

Basic usage

In your views:

from stagedoor.services import create_login_token

def login_view(request):
    # Create a token for user
    token = create_login_token(request, email="user@example.com")

    # Send the token via email
    # ... email sending logic here

    return redirect("token_post_page")

Metadata

Release files for django-stagedoor 0.3.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-stagedoor 0.3.3
File Size Uploaded Provenance Actions
django_stagedoor-0.3.3.tar.gz 15.3 kB With provenance Details for django_stagedoor-0.3.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-stagedoor 0.3.3
File Interpreter ABI Platform Actions
django_stagedoor-0.3.3-py3-none-any.whl Python 3 none any Details for django_stagedoor-0.3.3-py3-none-any.whl

Total release size: 35.3 kB

Release files / django_stagedoor-0.3.3.tar.gz

Download URL django_stagedoor-0.3.3.tar.gz
Size 15.3 kB
Tags Source
SHA-256 checksum
How to use checksums
85a0ca51403851fc85f95f720ceb2fc271cb694ed102d9515964283b119d9f87
BLAKE2b-256 checksum
How to use checksums
5e79118cadf89e8ac09eeb15ba9c03ffc24e7fe99781509ffb0b39f861c6bf7c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.

Transparency log

Release files / django_stagedoor-0.3.3-py3-none-any.whl

Download URL django_stagedoor-0.3.3-py3-none-any.whl
Size 20.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8fc43bdabe835af8cb5c324a2162525a5ce4dbca0ec48706e0f52b0b19d7e5c2
BLAKE2b-256 checksum
How to use checksums
04fc3dab208a1531f260612fb6caed3dd09171ae540c5ce960c1c18e6bacd949
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.

Transparency log

Security for django-stagedoor 0.3.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for django_stagedoor-0.3.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page