title: Please enter the correct Email and password for a staff account. Note that both fields may be case-sensitive
body: <p>I complete makemigrations and migrate then create a superuser. After this
  <a href="http://127.0.0.1:8000/admin" rel="nofollow noreferrer">http://127.0.0.1:8000/admin</a> i try to log in then show this error
  <em><strong>Please enter the correct Email and password for a staff account. Note that both fields may be case-sensitive</strong></em></p>
  <p><strong>seetings.py</strong></p>
  <pre><code>AUTH_USER_MODEL = 'user.CustomUser'
  
  
  **models.py**
  from django.db import models
  from django.contrib.auth.models import AbstractUser,BaseUserManager
  
  
  class CustomUserManager(BaseUserManager):
      &quot;&quot;&quot;
      Creates and saves a User with the given email, date of
      birth and password.
      &quot;&quot;&quot;
      def create_user(self, email, password=None):
          if not email:
              raise ValueError('User must have an email id')
  
          user=self.model(
              email=self.normalize_email(email)
          )
          user.set_password(password)
          user.save(using=self._db)
          return user
  
      def create_superuser(self, email, password=None):
          user=self.create_user(
              email,
              password=password
          )
          user.is_admin = True
          user.save(using=self._db)
          return user
  
  
  class CustomUser(AbstractUser):
      #only add email field for login
  
      email = models.EmailField(
          verbose_name='Email',
          max_length=50,
          unique=True
      )
      is_active = models.BooleanField(default=True)
      is_admin = models.BooleanField(default=False)
  
      objects = CustomUserManager()
  
      USERNAME_FIELD = 'email'
      REQUIRED_FIELDS = []
  
      def __str__(self):
          return self.email
  
  
  
  ***admin.py***
  
  from django.contrib import admin
  from django.contrib.auth import get_user_model
  
  user=get_user_model()
  
  admin.site.register(user)
  </code></pre>