title: Django: getting rid of circular dependency
body: <p>I have two apps, <code>commonapp</code> and <code>app1</code>.</p>
  
  <p>Here's <code>commonapp/models.py</code>:</p>
  
  <pre><code>from django.db import models
  #from app1.models import SpecificFields
  
  # Create your models here.
  class CommonFields(models.Model):
      a = models.IntegerField(default = 0)
  
      class Meta:
          abstract = True
  
  class SomeFields(models.Model):
  #    a = models.ForeignKey(SpecificFields)
      a = models.ForeignKey('app1.models.SpecificFields')
  </code></pre>
  
  <p>and here's <code>app1/models.py</code>:</p>
  
  <pre><code>from django.db import models
  from commonapp.models import CommonFields
  
  # Create your models here.
  class SpecificFields(CommonFields):
      a2 = models.IntegerField(default=0)
  </code></pre>
  
  <p>When I try to run the SQL from either <code>app1</code> or <code>commonapp</code>, I get the following error:</p>
  
  <pre><code>$ python manage.py sql commonapp
  CommandError: One or more models did not validate:
  commonapp.somefields: 'a' has a relation with model app1.models.SpecificFields,
  which has either not been installed or is abstract.
  </code></pre>
  
  <p>I realize this is an issue of a circular dependency.  Others have suggested of specifying the path to a class as a <a href="https://stackoverflow.com/questions/13195715/circular-dependency-in-django">string</a> instead of the actual class, but that does not work.  I also cannot specify a string as the base class name in the derived class.</p>
  
  <p>Is such a circular dependency possible without refactoring my models?</p>