Package: django-users2
Custom user model for django >=1.5 with support for multiple user types and
lots of other awesome utils (mostly borrowed from other projects). If you are
using django < 1.11, please install v0.2.1 or earlier (pip install
django-users2<=0.2.1).Featuresemail as username for authentication (barebone extendable user models)support for multiple user types (using the awesome django-model-utils)automatically creates superuser after syncdb/migrations (really handy during the initial development phases)built in emails/passwords validators (with lots of customisable options)prepackaged with all the templates, including additional templates required by views indjango.contrib.auth(for a painless signup process)DocumentationThe full documentation is athttps://django-users2.readthedocs.org.QuickstartInstalldjango-users2:pip install django-users2Adddjango-users2toINSTALLED_APPS:INSTALLED_APPS = (
    ...
    'django.contrib.auth',
    'django.contrib.sites',
    'users',
    ...
)Set yourAUTH_USER_MODELsetting to useusers.User:AUTH_USER_MODEL = 'users.User'Once you’ve done this, run themigratecommand to install the model used by this package:python manage.py migrateAdd thedjango-users2URLs to your project’s URLconf as follows:urlpatterns = patterns('',
    ...
    url(r'^accounts/', include('users.urls')),
    ...
)which sets up URL patterns for the views in django-users2 as well as several useful views in django.contrib.auth (e.g. login, logout, password change/reset)ConfigurationSetUSERS_VERIFY_EMAIL = Trueto enable email verification for registered users.When a newUserobject is created, with itsis_activefield set toFalse, an activation key is generated, and an email is sent to the user containing a link to click to activate the account:USERS_VERIFY_EMAIL = FalseUpon clicking the activation link, the new account is made active (i.e.is_activefield is set toTrue); after this, the user can log in. Optionally, you can automatically login the user after successful activation:USERS_AUTO_LOGIN_ON_ACTIVATION = TrueThis is the number of days the users will have, to activate their accounts after registering:USERS_EMAIL_CONFIRMATION_TIMEOUT_DAYS = 3Automatically create djangosuperuseraftersyncdb, by default this option is enabled whensettings.DEBUG = True.You can customise the email/password by overridingUSERS_SUPERUSER_EMAILandUSERS_SUPERUSER_PASSWORDsettings (highly recommended):USERS_CREATE_SUPERUSER = settings.DEBUG
USERS_SUPERUSER_EMAIL = 'superuser@djangoproject.com'
USERS_SUPERUSER_PASSWORD = 'django'Prevent automated registration by spambots, by enabling a hidden (using css) honeypot field:USERS_SPAM_PROTECTION = TruePrevent user registrations by settingUSERS_REGISTRATION_OPEN = False:USERS_REGISTRATION_OPEN = TrueSettings for validators, that check the strength of user specified passwords:# Specifies minimum length for passwords:
USERS_PASSWORD_MIN_LENGTH = 5

#Specifies maximum length for passwords:
USERS_PASSWORD_MAX_LENGTH = NoneOptionally, the complexity validator, checks the password strength:USERS_CHECK_PASSWORD_COMPLEXITY = TrueSpecify number of characters within various sets that a password must contain:USERS_PASSWORD_POLICY = {
        'UPPER': 0,       # Uppercase 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
        'LOWER': 0,       # Lowercase 'abcdefghijklmnopqrstuvwxyz'
        'DIGITS': 0,      # Digits '0123456789'
        'PUNCTUATION': 0  # Punctuation """!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~"""
}Allow/disallow registration using emails addresses from specific domains:USERS_VALIDATE_EMAIL_DOMAIN = TrueList of disallowed domains:USERS_EMAIL_DOMAINS_BLACKLIST = []For example,USERS_EMAIL_DOMAINS_BLACKLIST = ['mailinator.com']will block all visitors from using mailinator.com email addresses to register.List of allowed domains:USERS_EMAIL_DOMAINS_WHITELIST = []For example,USERS_EMAIL_DOMAINS_WHITELIST = ['ljworld.com']will only allow user registration with ljworld.com domains.