title: Attribute Error in Django model Foreign Key
body: <p>In My Django Project, there are two apps: Login and Company</p>
  <p>The <strong>error that am receiving</strong> in this is</p>
  <pre class="lang-py prettyprint-override"><code>AttributeError: module 'login.models' has no attribute 'Country'
  </code></pre>
  <p><em>Company App</em> &gt; models.py</p>
  <pre class="lang-py prettyprint-override"><code>from django.db import models
  from login import models as LM
  
  class CompanyProfile(models.Model):
      full_name            = models.CharField(max_length=255, 
                                              unique = True)
  
      country              = models.ForeignKey(LM.Country, 
                                              on_delete=models.SET_NULL, 
                                              null=True, 
                                              blank=False)
  
      state                = models.ForeignKey(LM.State, 
                                              on_delete=models.SET_NULL, 
                                              null=True, 
                                              blank=False)
      def __str__(self):
          return self.full_name
  </code></pre>
  <p><em>Login App</em> &gt; models.py</p>
  <pre class="lang-py prettyprint-override"><code>
  class Country(models.Model):
      &quot;&quot;&quot;List of Country&quot;&quot;&quot;
      name = models.CharField(max_length=50, unique= True, default='None')
      code = models.CharField(max_length=2, unique= True, primary_key=True, default ='NA')
  
      def __str__(self):
          return str(self.code)
  
  class State(models.Model):
      &quot;&quot;&quot;List fo State&quot;&quot;&quot;
      region = models.CharField(max_length = 255, unique = True, primary_key=True, default='None')
      country = models.ForeignKey(Country, on_delete=models.SET_NULL, null=True, blank=False, default ='NA')
  
      def __str__(self):
          return self.region
  
  </code></pre>
  <p>Here is test to check that weather is login is getting imported or not</p>
  <pre class="lang-py prettyprint-override"><code>def test_import():
      try:
          # import pdb; pdb.set_trace()
          importlib.find_loader('LM.Country')
          found = True
      except ImportError:
          found = False
      print(found)
  </code></pre>
  <p>Answer is received stands to be True</p>
  <pre><code>python3 manage.py shell
  &gt;&gt;&gt; test_import()
  True
  </code></pre>
  <p>Now on other stackoverflow blogs i checked i thought it could be of <code>Circlular Import</code>
  But i have already fixed that still am getting this error?</p>
  <p>Thanks in Advance
  Regards</p>