title: Django Field defines a relation with model , which is either not installed, or is abstract
body: <p>My code is as shown below:</p>
  
  <pre><code>class X(models.Model):
  
      class Meta:
          db_table = 'X'
  
      ph_no = models.CharField(max_length =255,null=False)
  
      y = models.ForeignKey('y',on_delete=models.CASCADE)
  
  
  class M(models.Model):
  
      class Meta:
          db_table = 'M'
  
      comment = models.CharField(max_length=255,null= False)
  
      x = models.ForeignKey('X',on_delete=models.CASCADE)
  
  
  
  class y (models.Model):
  
      class Meta:
          db_table = 'y'
  
      details =  models.TextField(null= False)
  </code></pre>
  
  <p>Now when , with this schema, I run the migrations, I get the following error</p>
  
  <pre><code>appName.M.x: (fields.E300) Field defines a relation with model 'X', which is either not installed, or is abstract.
  appName.M.x: (fields.E307) The field appName.M.x was declared with a lazy reference to 'appName.X', but app 'appName' doesn't provide model 'X'.
  </code></pre>
  
  <p>My settings.py file is as follows:</p>
  
  <pre><code>INSTALLED_APPS = [
      'django.contrib.admin',
      'django.contrib.auth',
      'django.contrib.contenttypes',
      'django.contrib.sessions',
      'django.contrib.messages',
      'django.contrib.staticfiles',
      'rest_framework',
      'rest_framework.authtoken',
      'dashboard'
  ]
  </code></pre>