Foreign key from one app into another in Django

Solution 1:

According to the docs, your second attempt should work:

To refer to models defined in another application, you must instead explicitly specify the application label. For example, if the Manufacturer model above is defined in another application called production, you'd need to use:

class Car(models.Model):
    manufacturer = models.ForeignKey('production.Manufacturer')

Have you tried putting it into quotes?

Solution 2:

It is also possible to pass the class itself:

from django.db import models
from production import models as production_models

class Car(models.Model):
    manufacturer = models.ForeignKey(production_models.Manufacturer)

Solution 3:

OK - I've figured it out. You can do it, you just have to use the right import syntax. The correct syntax is:

from prototype.cf.models import Movie

My mistake was not specifying the .models part of that line. D'oh!