title: ValueError: the field was declared with a lazy reference but app doesn't provide model
body: <p>I know there are several similar questions.
  But I don't understand where I need to change my dependencies. And I'm very afraid to change it, because I don't understand it.</p>
  <p>I have a lot problems when I created local database. I solved all isues. Then I go to production database. And have problems again. I solved it. And then I returned to development. And again I had issues.</p>
  <p>I think my problem is changing <code>event.Team</code> for production, when in development I have <code>Team</code> (<code>from mission.models import Team</code>). When I solved issues in production, I went to development database and I had:</p>
  <pre><code>ValueError: The field accounts.Member.id_team was declared with a lazy reference to 'event.team', but app 'event' doesn't provide model 'team'.
  
  class Member(models.Model):
      id_user = models.OneToOneField(User, on_delete=models.CASCADE, related_name=&quot;ninja&quot;, blank=True, null=True)
      id_team = models.ForeignKey(&quot;event.Team&quot;, null=True, blank=True, on_delete=models.SET_NULL)
  </code></pre>
  <p>this is my showmigration files:</p>
  <pre><code>[X] 0052_alter_member_id_user
   [ ] 0053_alter_member_id_user
   [ ] 0054_remove_member_id_team
   [ ] 0055_remove_member_id_user
   [ ] 0056_remove_goal_id_member
   [ ] 0057_member_id_user
   [ ] 0058_remove_member_id_user
   [ ] 0059_member_id_team_member_id_user
   [ ] 0060_remove_member_id_user
   [ ] 0061_delete_member
   [ ] 0062_member
   [ ] 0063_delete_member
   [ ] 0064_member
   [ ] 0065_member_id_team_member_id_user
   [ ] 0066_remove_member_id_team
   [ ] 0067_member_id_team
  </code></pre>
  <p>Can you please advice. In what migration files I need to write some new dependecies and what dependecies I need to write.</p>
  <p>This is my mission(app) migration history:</p>
  <pre><code>[X] 0017_initial
   [ ] 0018_team_alter_event_goal_time
   [ ] 0019_team_id_event
   [ ] 0020_remove_team_id_event
   [ ] 0021_delete_team
   [ ] 0022_team
   [ ] 0023_team_id_mission
   [ ] 0024_team_date_created_team_name
   [ ] 0025_team_leader
   [ ] 0026_delete_team
   [ ] 0027_team
  </code></pre>
  <p>I repeat again, I don't understand how to change dependecies correctly to avoid critical mistakes. So I need your help. This issue appeared after makemigrations, migrate, migrate --fake.
  But in production database I haven't this problem.
  And also before deploying into production and when I had <code>Team</code> instead <code>&quot;event.Team&quot;</code> it was working.</p>
  <pre><code>from event.models import Team
  id_team = models.ForeignKey(Team, null=True, blank=True, on_delete=models.SET_NULL)
  </code></pre>