How To: Integrate Improved User Directly

Warning

This configuration method is but one of three, and may not make the most sense for your project. Please read Select a Configuration Method for Improved User before continuing, or else follow the instructions in Quickstart: Using Improved User.

In a new Django project, perform the following steps in the settings.py file or base settings file.

  1. Add improved_user.apps.ImprovedUserConfig to INSTALLED_APPS

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

    AUTH_USER_MODEL='improved_user.User'
    
  3. 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
    ]
    

Note

Improved user also comes with forms, test factories, and an admin panel. Take a look at the Package Reference for more information.