“django.db.utils.ProgrammingError: relation ”app_user“ does not exist” during manage.py test

前端 未结 6 781
你的背包
你的背包 2020-12-10 15:02

My setup:

  • Django 1.8.3
  • Python 2.7.10
  • Ubuntu 14.04
  • django-two-factor-auth==1.2.0

I get the following error when I ru

6条回答
  •  执念已碎
    2020-12-10 15:07

    You have not given any code so its difficult to understand your models relations. But can I guess that you have passed the ForeignKey model as an instance? Try to give it as a string

    class MyModel(models.Model):
        fk_field = models.ForeignKey('path.to.other.model')    # same as from path.models import model
    

    This usually works out. Hope it does for you too!

提交回复
热议问题