Skip to main content

A Django app to use email as username for user authentication.

Project description

https://badge.fury.io/py/django-use-email-as-username.svg https://github.com/jmfederico/django-use-email-as-username/actions/workflows/tests.yml/badge.svg https://codecov.io/gh/jmfederico/django-use-email-as-username/branch/master/graph/badge.svg https://img.shields.io/badge/code%20style-black-000000.svg

A Django app to use email as username for user authentication.

Features

  • Custom User model with no username field

  • Use email as username

  • Includes a django-admin command for quick install

  • Follow Django best practices for new Django projects and User models.

Quickstart

  1. Install Django use Email as Username:

    # Run in your terminal
    pip install django-use-email-as-username
  2. Add it to your INSTALLED_APPS:

    # In your settings.py file
    INSTALLED_APPS = (
        ...
        'django_use_email_as_username.apps.DjangoUseEmailAsUsernameConfig',
        ...
    )
  3. Create your new django app:

    # Run in your terminal
    python manage.py create_custom_user_app
  4. Add the new app to your INSTALLED_APPS:

    # In your settings.py file
    INSTALLED_APPS = (
        ...
        'django_use_email_as_username.apps.DjangoUseEmailAsUsernameConfig',
        'custom_user.apps.CustomUserConfig',
        ...
    )
  5. Now instruct Django to use your new model:

    # In your settings.py file
    AUTH_USER_MODEL = 'custom_user.User'
  6. Create and run migrations:

    # Run in your terminal
    python manage.py makemigrations
    python manage.py migrate

You now have a new Django app which provides a custom User model.

You can further modify the new User Model any time in the future, just remember to create and run the migrations.

Notes

This app gives you a custom User model, which is good practice for new Django projects.

Changing to a custom user model mid-project is not easy.

It is recommended to always create a custom User model at the beginning of every Django project.

Credits

Tools used in rendering this package:

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_use_email_as_username-1.4.0.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file django_use_email_as_username-1.4.0.tar.gz.

File metadata

File hashes

Hashes for django_use_email_as_username-1.4.0.tar.gz
Algorithm Hash digest
SHA256 58a6f38a487a887bcaefa5435a5abf5620994805f68cb62b2dc3f226bf177fb9
MD5 963874a6e8a1711abfe75e3070bb2057
BLAKE2b-256 1d4fb1459d41bb1dbd790c7329df34047c2aec2f7fb890dcfb1891d31d1e93d2

See more details on using hashes here.

File details

Details for the file django_use_email_as_username-1.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_use_email_as_username-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4ac2dc6f7d9c0ad7c156fb56a872f6d32bbf21af0a16748dd84650f5d9deaca3
MD5 f16b57250785f5f9fc413a7020bfa4f7
BLAKE2b-256 d03568c52a013819ec1e0adaf45f8d6b97c5671d8c40f2f71163d88d9ccee8e0

See more details on using hashes here.

Supported by

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