Skip to main content

Django Rapyd ModernAuth

PyPI version Python versions License CI

A small Django pluggable app that provides a custom User model where the email address is the username. No username field, no extra settings, no migrations beyond the initial one.

Inspiration

Users today expect to use their email address as the username during authentication. This works well because:

  • Users already know their email addresses by heart.
  • Since email addresses are unique, users don't need to remember yet another item when either signing up or logging into web applications. IMHO this is a significant factor that plays a vital role in user adoption.
  • This is a time tested model and many web applications today follow this.

However, Django's default approach for authentication requires a user provide both a username and an email address during sign up and then just use the username during login.

Requirements

  • Python 3.10, 3.11, 3.12, or 3.13
  • Django 4.2 LTS or Django 5.2 LTS

Installation

Important: swap in this user model before running migrate for the first time. Switching AUTH_USER_MODEL mid-project requires hand-written data migrations across every foreign key to the user model. See Django's docs on substituting a custom user model.

Install the package:

pip install django-rapyd-modernauth

Add modernauth to INSTALLED_APPS:

INSTALLED_APPS = [
    # ...
    "modernauth",
]

Point Django at the custom user model in settings.py:

AUTH_USER_MODEL = "modernauth.User"

Create the database tables:

python manage.py migrate

Usage

The custom User model behaves like Django's default AbstractUser with one difference: email is the unique identifier and there is no username field. Use get_user_model() rather than importing the model directly so your code keeps working if AUTH_USER_MODEL is ever swapped again.

from django.contrib.auth import get_user_model

User = get_user_model()

User.objects.create_user(email="alice@example.com", password="…")
User.objects.create_superuser(email="root@example.com", password="…")

The admin's createsuperuser command will prompt for an email instead of a username:

python manage.py createsuperuser

Login forms, the admin, and authenticate() all use email as the credential.

Contributing

Pull requests are welcome — the project is intentionally small, so bug fixes, test improvements, and Django LTS support updates are the most likely to land. See CONTRIBUTING.md for the full development setup, test workflow, and release process.

For security vulnerabilities, see SECURITY.md for the private disclosure process. Do not file a public issue for security bugs.

License

Apache License 2.0 — see LICENSE.

Metadata

Release files for django-rapyd-modernauth 0.0.7

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-rapyd-modernauth 0.0.7
File Size Uploaded Provenance Actions
django_rapyd_modernauth-0.0.7.tar.gz 13.8 kB With provenance Details for django_rapyd_modernauth-0.0.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-rapyd-modernauth 0.0.7
File Interpreter ABI Platform Actions
django_rapyd_modernauth-0.0.7-py3-none-any.whl Python 3 none any Details for django_rapyd_modernauth-0.0.7-py3-none-any.whl

Total release size: 29.7 kB

Release files / django_rapyd_modernauth-0.0.7.tar.gz

Download URL django_rapyd_modernauth-0.0.7.tar.gz
Size 13.8 kB
Tags Source
SHA-256 checksum
How to use checksums
0ba189f4ce2fe23bf1e13325de230d627313b9ad127445878043eabac7fabbf1
BLAKE2b-256 checksum
How to use checksums
14993b5686de89c810e374b5d17b8aa9cf141d7af0df30b330c3bd2117bec219
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 May 4, 2026.

Transparency log

Release files / django_rapyd_modernauth-0.0.7-py3-none-any.whl

Download URL django_rapyd_modernauth-0.0.7-py3-none-any.whl
Size 16.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ca3bd232eb53bb8c3d22a52b65f8860fe7ca1bbe7688eef6b077085942673bd7
BLAKE2b-256 checksum
How to use checksums
6a71a5a004b191edca1d37fa0dee78fef0fa398d3599dbc3585151c8ef698969
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 May 4, 2026.

Transparency log

Security for django-rapyd-modernauth 0.0.7

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_rapyd_modernauth-0.0.7.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 May 4, 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.

Release history Release notifications | RSS feed

This release

0.0.7 This release

2 release files Full provenance

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