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

Installation

In a Terminal, use pip to install the package from [PyPI](https://pypi.org/).

pip install django-improved-user

If you intend to use the UserFactory provided by the package to allow for testing with [factory_boy](https://github.com/FactoryBoy/factory_boy), you can specify so during install.

pip install django-improved-user[factory]

If you do not but wish to use the UserFactory, you will need to install [factory_boy](https://github.com/FactoryBoy/factory_boy) yourself.

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

To run the test suite on a single version of Django (assuming you have a version of Django installed), run the runtests.py script from the root of the project.

$ python runtests.py

You can limit the tests or pass paramaters as if you had called manage.py test.

$ ./runtests.py tests.test_basic -v 3

To run all linters and test multiple Python and Django versions, use tox.

$ tox

You will need to install Python 3.4, 3.5, and 3.6 on your system for this to work.

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.4.0.tar.gz (31.7 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.4.0-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for django-improved-user-0.4.0.tar.gz
Algorithm Hash digest
SHA256 32f2e92b40702474439337fdf0c1233e606f5dfe97105e1d565c2d361feed977
MD5 4099e5d9898fc40ac1eac85718d4cb7b
BLAKE2b-256 a8d7d1637f5cbf54e8b54ca71adee45def2acc6a8591ee58f0a0b9dc1b41210b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_improved_user-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 719c5362f408c8cbf68989adb89b5e473ec82bb156b6dd1c45638747a213a5de
MD5 ab1f83d3adfeaead5db9f6f6b168069b
BLAKE2b-256 e488c0e0fe7d7279d52ba570ee4b4be0a7bdd75cd2d24d32fc76d3e40deed0f6

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 Sentry Error logging StatusPage Status page