Django Migration,无法找到`User`字段

时间:2018-05-06 14:24:21

标签: python django migration

class Tld(models.Model): #TODO...resolve `User` table issue for FKtoClient
    #other fields
    FKtoClient = models.ForeignKey('User', on_delete=models.PROTECT)  

当我尝试运行时: python ../manage.py makemigrations Myapp

它说:

Myapp.Tld.FKtoClient: (fields.E300) Field defines a relation with model 'User', which is either not installed, or is abstract.
Myapp.Tld.FKtoClient: (fields.E307) The field Myapp.Tld.FKtoClient was declared with a lazy reference to 'Myapp.user', but app 'Myapp' doesn't provide model 'user'.

我该如何解决这个问题?

谢谢。

0 个答案:

没有答案