How to remove the password in the users table and User class in a custom user model?
I'm using django-rest-framework token authentication, so i don't need the password field.
Here is my model:
class CustomUserManager(BaseUserManager):
def create_user(phone, name=None):
return User.objects.create(
name=name, phone=phone)
def create_superuser(name, phone=None):
pass
class User(AbstractBaseUser):
"""
Custom django User model.
"""
name = models.CharField(max_length=30,
null=True, validators=[validate_name])
phone = PhoneNumberField(unique=True, blank=False, null=False)
objects = CustomUserManager()
USERNAME_FIELD = 'phone'
REQUIRED_FIELDS = []
Please correct the errors below.
error – Sheasheaf