title: Django abstract user model not migrating
body: <p>So I am working on implementing a custom user model, and to do so i followed tutorial '<a href="https://www.fomfus.com/articles/how-to-use-email-as-username-for-django-authentication-removing-the-username" rel="nofollow noreferrer">this</a> tutorial. </p>
  
  <p>These are the models:</p>
  
  <pre><code>class UserManager(BaseUserManager):
      """Define a model manager for User model with no username field."""
  
      use_in_migrations = True
  
      def _create_user(self, email, password, **extra_fields):
          """Create and save a User with the given email and password."""
          if not email:
              raise ValueError('The given email must be set')
          email = self.normalize_email(email)
          user = self.model(email=email, **extra_fields)
          user.set_password(password)
          user.save(using=self._db)
          return user
  
      def create_user(self, email, password=None, **extra_fields):
          """Create and save a regular User with the given email and password."""
          extra_fields.setdefault('is_staff', False)
          extra_fields.setdefault('is_superuser', False)
          return self._create_user(email, password, **extra_fields)
  
      def create_superuser(self, email, password, **extra_fields):
          """Create and save a SuperUser with the given email and password."""
          extra_fields.setdefault('is_staff', True)
          extra_fields.setdefault('is_superuser', True)
  
          if extra_fields.get('is_staff') is not True:
              raise ValueError('Superuser must have is_staff=True.')
          if extra_fields.get('is_superuser') is not True:
              raise ValueError('Superuser must have is_superuser=True.')
  
          return self._create_user(email, password, **extra_fields)
  
  
  class User(AbstractUser):
      """User model."""
  
      username = None
      email = EmailField(_('email address'), unique=True)
  
      USERNAME_FIELD = 'email'
      REQUIRED_FIELDS = []
  
      objects = UserManager()
  </code></pre>
  
  <p>I am now trying to run <code>python3 manage.py migrate</code> and I get this error:</p>
  
  <pre><code>[wtreston] ~/gdrive/mysite2/ $ python3 manage.py migrate
  Operations to perform:
    Apply all migrations: admin, auth, contenttypes, reviews, sessions, users
  Traceback (most recent call last):
    File "manage.py", line 22, in &lt;module&gt;
      execute_from_command_line(sys.argv)
    File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
      utility.execute()
    File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/core/management/__init__.py", line 356, in execute
      self.fetch_command(subcommand).run_from_argv(self.argv)
    File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/core/management/base.py", line 283, in run_from_argv
      self.execute(*args, **cmd_options)
    File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/core/management/base.py", line 330, in execute
      output = self.handle(*args, **options)
    File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/core/management/commands/migrate.py", line 164, in handle
      pre_migrate_apps = pre_migrate_state.apps
    File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/utils/functional.py", line 35, in __get__
      res = instance.__dict__[self.name] = self.func(instance)
    File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/db/migrations/state.py", line 218, in apps
      return StateApps(self.real_apps, self.models)
    File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/db/migrations/state.py", line 295, in __init__
      raise ValueError("\n".join(error.msg for error in errors))
  ValueError: The field admin.LogEntry.user was declared with a lazy reference to 'users.user', but app 'users' doesn't provide model 'user'.
  The field reviews.Answer.student was declared with a lazy reference to 'users.user', but app 'users' doesn't provide model 'user'.
  The field reviews.ReviewBlock.teacher was declared with a lazy reference to 'users.user', but app 'users' doesn't provide model 'user'.
  The field users.Student.user was declared with a lazy reference to 'users.user', but app 'users' doesn't provide model 'user'.
  The field users.Teacher.user was declared with a lazy reference to 'users.user', but app 'users' doesn't provide model 'user'.
  </code></pre>
  
  <p>In my settings.py I have this line <code>AUTH_USER_MODEL = 'users.User'
  </code>. and when I reference the <code>AUTH_USER_MODEL</code> with ForeignKeys, I first have <code>from mysite import settings</code> and then have <code>ForeignKey(settings.AUTH_USER_MODEL)</code></p>
  
  <p>Any help would be helpful! Thanks</p>