Issue with createsuperuser when implementing custom user model

后端 未结 2 1171
囚心锁ツ
囚心锁ツ 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:28

    class User(AbstractBaseUser, PermissionsMixin):
        username = models.CharField('username', max_length=150, unique=True)
        email = models.EmailField('email address', unique=True, max_length = 255)
        USERNAME_FIELD = 'username'
        REQUIRED_FIELDS = ['email']
    

    For me above code simply solved problems.

提交回复
热议问题