Basic Configuration¶
Configure
INSTALLED_APPS
insettings.py
:INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', ... 'django_flex_user.apps.DjangoFlexUserConfig', # Add me 'rest_framework', # Add me 'rest_framework.authtoken', # Add me 'drf_multiple_model', # Add me 'social_django', # Add me ]
Configure
AUTHENTICATION_BACKENDS
insettings.py
:AUTHENTICATION_BACKENDS = [ 'django_flex_user.backends.FlexUserModelBackend', ]
Configure
AUTH_USER_MODEL
insettings.py
:AUTH_USER_MODEL = 'django_flex_user.FlexUser'
Warning
You cannot change the AUTH_USER_MODEL setting during the lifetime of a project (i.e. once you have made and migrated models that depend on it) without serious effort. It is intended to be set at the project start, and the model it refers to must be available in the first migration of the app that it lives in. See Substituting a custom User model for more details.
Register a callback function for sending emails in
settings.py
:FLEX_USER_OTP_EMAIL_FUNCTION = ...
Your callback function should have the following signature:
Register a callback function for sending SMS messages in
settings.py
:FLEX_USER_OTP_SMS_FUNCTION = ...
Your callback function should have the following signature:
Apply database migrations:
$ python mange.py migrate
Note
On Windows, the command to execute Python is
py
.Create a superuser:
$ python mange.py createsuperuser
Note
On Windows, the command to execute Python is
py
.