Note to self: Django's Error: cannot import name Foo

If Foo is definitely defined, then this is most likely a circular import which can be avoided by dropping the "redundant" import statement and referring not directly to the Model itself, but its' name. This is known as a lazy relationship:
foo = models.ForeignKey('Foo')

Tagged with:

Categorised as: