title: What is the correct way to reference nested django apps in ManytoManyFields
body: <p>I'm trying to update an old django app from 1.1.x to 1.8 LTS, which has involved updating paths, as I apps move apps around.</p>
  
  <p>However, I'm unable to generate migrations for one app, and I can't see how to reference a namespaced app model correctly (assuming that's the problem)</p>
  
  <p>If I've moved files from PROJECT/news/models to  PROJECT/site_name/news/models, how should I be referencing these models in in foreign keys or ManyToManyFields?</p>
  
  <h1>My app</h1>
  
  <p>I have a <code>projects</code> app I want to make migrations for. Projects in <code>some_org/projects</code>, and listed in installed apps like so:</p>
  
  <pre><code>INSTALLED_APPS = (
      'some_org.maps',
      'some_org.library',
      'some_org.extras',
      'some_org.news',
      'some_org.projects',
      'some_org.members',
      'some_org.comments',
  )
  </code></pre>
  
  <p>All the apps with the namespace are within the <code>some_org</code> directory.</p>
  
  <p>Here's an abridged view of the models file in the projects app:</p>
  
  <pre><code># some_org/projects/models.py
  
  from some_org.library import Paper
  
  
  class Project(models.Model):
      name = models.CharField(max_length=30)
  
      def get_children(self):
          return ProjectPage.objects.filter(level=1, publish=True, project=self)
  
      def has_library(self):
          return Paper.objects.filter(projects=self).count() &gt; 0
  </code></pre>
  
  <p>Calling ./manage.py makemigrations library, gives me this error:</p>
  
  <pre><code>ValueError: Lookup failed for model referenced by field library.Paper.projects: projects.Project
  </code></pre>
  
  <p>When I look in the Paper model, it looks like this:</p>
  
  <pre><code>class Paper(models.Model):
  
  # snip
  
  # NewsLinkSubject, Projects et al used to in an app on 
  # the project root, like `./app_name/models.py`, but is now 
  # in `some_org/app_name/models.py`
  
  subjects = models.ManyToManyField("news.NewsLinkSubject", blank=True)
  projects = models.ManyToManyField("projects.Project", blank=True,)
  country =  models.ForeignKey("maps.Country", null=True, blank=True)
  </code></pre>
  
  <p>I initially wonder if the label for the app is wrong, and try the projects ManytoMany field to:</p>
  
  <pre><code>projects = models.ManyToManyField("some_org.projects.Project", blank=True,) 
  </code></pre>
  
  <p>This gives a different error:</p>
  
  <pre><code>ERRORS:
  library.Paper.subjects: (fields.E300) Field defines a relation with model some_org.projects.Project', which is either not installed, or is abstract.
  </code></pre>
  
  <p>As far as I can tell the app is installed, and the models aren't abstract. </p>
  
  <p>I'm pretty stumped - what am I doing wrong, and how can I fix this so I can make migrations for these apps?</p>
  
  <p>I'm using Django 1.8.17, and Python 2.7.13.</p>