Skip to main content

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

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.3.0.tar.gz (29.1 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.3.0-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for django-improved-user-0.3.0.tar.gz
Algorithm Hash digest
SHA256 6ca832e6ed2517be26a2f4636c5275c952fcd01c4e1486a8bc1589d14d729f01
MD5 80e0f93dccb96a2b24f2644f1082a7d5
BLAKE2b-256 35048e6756d9532137bf6ec62ba5d760dd522c68f19bae0bfa2d57a3b21e8905

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_improved_user-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1885d88582d9cef6c45631ed68cbc2cb7d7fc7c4833ebb846f4704208c4b1ca8
MD5 ddedf5cefaa397e2496e34cbc13d09ac
BLAKE2b-256 a8134702c8d2ca2c50acc97ef4cdc757c63f80011c2e9788aa332c5e1b9ee663

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