title: AUTH_USER_MODEL refers to model '%s' that has not been installed"
body: <p>I'm using a CustomUser in my model. This is the User Manager.</p>
  
  <pre><code>class UserManager(BaseUserManager):
  
      def create_user(self, email, username, password=None, is_staff=False, is_superuser=False, is_active=False,
                      is_bot=False, is_mobile_verified=False, is_online=True, is_logged_in=True):
          logger = logging.getLogger(__name__)
          logger.info("REGULAR user created!")
          if not email:
              raise ValueError('Email is required')
          if not username:
              raise ValueError('Username is required.')
          email = self.normalize_email(email)
          user = self.model(email=email, username=username, is_staff=is_staff, is_superuser=is_superuser,
                            is_active=is_active, is_bot=is_bot, is_mobile_verified=is_mobile_verified,
                            is_online=is_online, is_logged_in=is_logged_in)
          user.set_password(password)
          user.save(using=self._db)
          return user
  
      def create_superuser(self, email, username, password):
          logger = logging.getLogger(__name__)
          logger.info("SUPER user created!")
          return self.create_user(email, username, password=password, is_staff=True, is_superuser=True, is_active=True,
                                  is_bot=False, is_mobile_verified=False, is_online=True, is_logged_in=True)
  </code></pre>
  
  <p>This is my definition of the custom user model.</p>
  
  <pre><code>class User(AbstractBaseUser, PermissionsMixin):
      email = models.EmailField(unique=True, max_length=255)
      mobile = PhoneNumberField(null=True)
      username = models.CharField(null=False, unique=True, max_length=255)
      full_name = models.CharField(max_length=255, blank=True, null=True)
      birthday = models.DateField(null=True)
      gender = models.CharField(max_length=255, null=True)
      is_staff = models.BooleanField(default=False)
      is_superuser = models.BooleanField(default=False)
      is_active = models.BooleanField(default=False)
      is_mobile_verified = models.BooleanField(default=False)
      is_online = models.BooleanField(default=False)
      is_logged_in = models.BooleanField(default=True)
      is_bot = models.BooleanField(default=False)
      location = models.ForeignKey(Location, on_delete=models.SET_NULL, null=True)
  
      USERNAME_FIELD = 'email'
      REQUIRED_FIELDS = ['username']
      #objects = UserManager()
  
      get_user_model().objects.create_user(...)
  </code></pre>
  
  <p>If I uncomment the line <code>objects = UserManager()</code> then I can run the server but the super users created from the admin backend can't log in.
  If I use <code>get_user_model()</code> the code breaks and I get the following error</p>
  
  <pre><code> "AUTH_USER_MODEL refers to model '%s' that has not been installed" % settings.AUTH_USER_MODEL
  django.core.exceptions.ImproperlyConfigured: AUTH_USER_MODEL refers to model 'bouncer.User' that has not been installed
  </code></pre>
  
  <p>But in my settings.py I've define auth user model</p>
  
  <pre><code>AUTH_USER_MODEL = 'bouncer.User'
  
  AUTHENTICATION_BACKENDS = (
      'django.contrib.auth.backends.ModelBackend',
  )
  </code></pre>
  
  <p>What am I doing wrong here?</p>