一枚奇怪的事

部署公司产品博客的时候,用python manage.py syncdb命令,创建表什么的都很正常,在创建超级用户时报如下错:

self.UserModel._default_manager.db_manager(database).create_superuser(**user_data)
TypeError: create_superuser() got an unexpected keyword argument 'nick_name'

google半天无解,试着在自定义里注释掉nick_name唯一的代码,就ok了,暂时不知道为嘛,先记下。

USERNAME_FIELD = 'email'
    #REQUIRED_FIELDS = ['nick_name']
For example, "name@something.com". If someone replies to you it will be via email.
For example, "http://someaddress.com"