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")

Release files for django-stagedoor 0.3.1

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.1
File Size Uploaded
django_stagedoor-0.3.1.tar.gz 15.3 kB Details

Built distribution (wheel)

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

Total release size: 35.3 kB

Release files / django_stagedoor-0.3.1.tar.gz

Download URL django_stagedoor-0.3.1.tar.gz
Size 15.3 kB
Tags Source
SHA-256 checksum
How to use checksums
dce0870adf113e4f8392f0064bf0e3d1c65d863ba2d621e1ce43ce30c2623d80
BLAKE2b-256 checksum
How to use checksums
0e65ac05e20c7e67c3c2824ce2d3065cf139b8cbe982e92d6fc3b501180ff299
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 2, 2026.

Transparency log

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

Download URL django_stagedoor-0.3.1-py3-none-any.whl
Size 20.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3ee7211b80eaedb6d4798ffdca3024c51a6114efa5a35e7b65d71a6e55a7286f
BLAKE2b-256 checksum
How to use checksums
ec48a9091744f346e79b427f474d0252227267273433b4c5b207b380f352e4f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 2, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files

0.2.0

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

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