Создание проблемы суперпользователя в django
Моя модель выглядит следующим образом.
from django.db import models
from django.contrib.auth.models import AbstractUser
# Create your models here.
class User(AbstractUser):
GENDER_CHOICES = (
('M', 'Male'),
('F', 'Female'),
('O', 'Other'),
)
USER_TYPE = (
('S', 'Super Admin'),
('A', 'Admin'),
('P', 'Patient'),
('D', 'Doctor'),
('U', 'User'),
)
first_name = models.CharField(max_length=255)
last_name = models.CharField(max_length=255)
date_of_birth = models.DateField(null=True, default=None)
gender = models.CharField(max_length=1, choices=GENDER_CHOICES)
user_type = models.CharField(max_length=1, choices=USER_TYPE)
username = models.EmailField(unique=True)
email = models.EmailField(unique=True)
phone = models.CharField(max_length=15, blank=True, null=True)
address = models.TextField(blank=True, null=True)
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
active = models.BooleanField(default=True)
REQUIRED_FIELDS = ['email', 'password']
def __str__(self):
return f"{self.first_name} {self.last_name}"
Я пытаюсь выполнить эту команду.
python manage.py createsuperuser
Я получаю ошибки