How to use standart django User library in my models with ForeignKey? I tried to use this code:
如何使用ForeignKey在我的模型中使用标准django用户库?我试着用这个代码:
class File(models.Model):
name = models.CharField(max_length=30)
uploader = models.ForeignKey('django.contrib.auth.models.User')
But it throws an error such as this User model doesn't exist.
但它会抛出一个错误,例如此用户模型不存在。
1 个解决方案
#1
1
uploader = models.ForeignKey('auth.User')
#1
1
uploader = models.ForeignKey('auth.User')