I have defined two models where each one references the other, like so:
class User(models.Model):
# ...
loves = models.ManyToManyField(Article, relat
You can find the solution in the docs:
If you need to create a relationship on a model that has not yet been defined, you can use the name of the model, rather than the model object itself:
class Car(models.Model): manufacturer = models.ForeignKey('Manufacturer') # ... class Manufacturer(models.Model): # ...