A custom user model replaces Django's default User, typically by inheriting from AbstractUser or AbstractBaseUser, in order to add fields or log in by email. It must be defined at the very start of the project, before the first migration, because changing it afterward is very difficult. It is declared in the AUTH_USER_MODEL setting.
Example
AUTH_USER_MODEL = 'accounts.User'