Issue with createsuperuser when implementing custom user model

后端 未结 2 1170
囚心锁ツ
囚心锁ツ 2020-12-10 13:53

I am trying to implement my own custom user model in Django 1.6 but I am getting this error.

Traceback (most recent call last):
  File \"./manage.py\", line          


        
2条回答
  •  天涯浪人
    2020-12-10 14:32

    Looking at the code for the management commands, it only prompts for fields in the user model's REQUIRED_FIELDS attribute (as well as username). That attribute contains email by default in AbstractBaseUser, but if you have overridden it - or not inherited from that model in the first place (which you should be doing) - then email will not be prompted, and not passed to the create_superuser method.

提交回复
热议问题