Skip to main content

A custom Django user model for best practices email-based login.

Project description

This project provides a custom user model that improves on Django’s default by making a few modern and international changes.

  • Uses email as the username to simplify login for users

  • Replace first_name and last_name with international friendly short_name full name fields

Usage

Perform the following steps in your settings.py file.

  1. Add improved_user.apps.ImprovedUserConfig (or simply improved_user) to INSTALLED_APPS

  2. Define or replace AUTH_USER_MODEL with he new model, as below.

    AUTH_USER_MODEL='improved_user.User'
  3. In Django > 1.9, change UserAttributeSimilarityValidator to match correct User fields, as shown below.

    AUTH_PREFIX = 'django.contrib.auth.password_validation.'
    AUTH_PASSWORD_VALIDATORS = [
        {
            'NAME': AUTH_PREFIX + 'UserAttributeSimilarityValidator',
            'OPTIONS': {
                'user_attributes': ('email', 'full_name', 'short_name')
            },
        },
        # include other password validators here
    ]

Testing

>From the root directory of the project, run the code below.

$ python runtests.py

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-improved-user-0.2.0.tar.gz (20.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_improved_user-0.2.0-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file django-improved-user-0.2.0.tar.gz.

File metadata

File hashes

Hashes for django-improved-user-0.2.0.tar.gz
Algorithm Hash digest
SHA256 b94ff5f2a8a39c846abe4a50a9cb5b6e1346c831324ea38660bae4e149078404
MD5 bbfe0d15f08bd38199fd5f3d664fd591
BLAKE2b-256 e212f5f081c0966921518f12caed23f8706b5c0568040b68885ed348adbc3075

See more details on using hashes here.

File details

Details for the file django_improved_user-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_improved_user-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 174794219e8b126a5af9c5012535f90c7d2e3c62ad1d18893866cf45d112448c
MD5 b760735a6b27657c14935f07d86c27fc
BLAKE2b-256 8d100f59a62f7ced61765a4f28e655b7d789b1f774ff29f3cd3f2e277cb392d8

See more details on using hashes here.

Supported by

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