当前位置:   article > 正文

DJango数据迁移报错:AttributeError: type object has no attribute 'REQUIRED_FIELDS'_attributeerror: type object 'user' has no attribut

attributeerror: type object 'user' has no attribute 'required_fields

原因是我使用了自己的user模型, 字段不全,在自己的user模型User中继承django自带的AbstractUser类即可

 

class User(AbstractUser):
    ...略...
    mobile = models.CharField(max_length=11, unique=True, verbose_name='手机号', null=True)
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/羊村懒王/article/detail/253814
推荐阅读
相关标签
  

闽ICP备14008679号