Custom User Model, Authentication, Templates, Email as username
Warning: Define 'Custom User model' in 'settings.py' file.
AUTH_USER_MODEL = 'accounts.CustomUser'
And in 'settings.py' to, the app where is the custom user model, must be before 'django.contrib.admin',
# Application definition INSTALLED_APPS = [ 'accounts', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes',
Attention:
To hide sensitive values in the settings.py file, such as directions and passwords, I use Python Decouple.
Instructions at https://pypi.org/project/python-decouple/
In the repository, rename the file '.env.example' to '.env' and make the necessary changes to your data.