title: Split models.py into several files
body: <p>I'm trying to split the <code>models.py</code> of my app into several files:</p>
  
  <p>My first guess was do this:</p>
  
  <pre><code>myproject/
      settings.py
      manage.py
      urls.py
      __init__.py
      app1/
          views.py
          __init__.py
          models/
              __init__.py
              model1.py
              model2.py
      app2/
          views.py
          __init__.py
          models/
              __init__.py
              model3.py
              model4.py
  </code></pre>
  
  <p>This doesn't work, then i found <a href="https://stackoverflow.com/questions/1160579/models-py-getting-huge-what-is-the-best-way-to-break-it-up">this</a>, but in this solution i still have a problem, when i run <code>python manage.py sqlall app1</code> I got something like:</p>
  
  <pre><code>BEGIN;
  CREATE TABLE "product_product" (
      "id" serial NOT NULL PRIMARY KEY,
      "store_id" integer NOT NULL
  )
  ;
  -- The following references should be added but depend on non-existent tables:
  -- ALTER TABLE "product_product" ADD CONSTRAINT "store_id_refs_id_3e117eef" FOREIGN KEY     ("store_id") REFERENCES "store_store" ("id") DEFERRABLE INITIALLY DEFERRED;
  CREATE INDEX "product_product_store_id" ON "product_product" ("store_id");
  COMMIT;
  </code></pre>
  
  <p>I'm not pretty sure about this, but i'm worried aboout the part <code>The following references should be added but depend on non-existent tables:</code></p>
  
  <p>This is my model1.py file:</p>
  
  <pre><code>from django.db import models
  
  class Store(models.Model):
      class Meta:
          app_label = "store"
  </code></pre>
  
  <p>This is my model3.py file:</p>
  
  <pre><code>from django.db import models
  
  from store.models import Store
  
  class Product(models.Model):
      store = models.ForeignKey(Store)
      class Meta:
          app_label = "product"
  </code></pre>
  
  <p>And apparently works but i got the comment in <code>alter table</code> and if I try this, same thing happens:</p>
  
  <pre><code>class Product(models.Model):
      store = models.ForeignKey('store.Store')
      class Meta:
          app_label = "product"
  </code></pre>
  
  <p>So, should I run the alter for references manually? this may bring me problems with south?</p>