[Answered ]-Django 3 NameError: name 'model_name' is not defined

1👍

I am posting as an answer what @TonySuffolk66 suggested via a comment since it worked perfectly. Thanks again!

Because your models are defined in different files, try doing this : poi = models.ForeignKey(‘Poi’, on_delete=models.CASCADE) That is using a string for the model name, not a reference name. You can’t ‘easily’ import other models like this due to the way that Django initializes

Leave a comment