Created
September 9, 2020 11:50
-
-
Save NerdPraise/fffecce97745ae0ed9ff25e5042954f6 to your computer and use it in GitHub Desktop.
User Model
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User(AbstractUser): | |
username = models.CharField(max_length=20, unique=False) | |
email = models.EmailField(_('email address'), unique=True) | |
USERNAME_FIELD = 'email' | |
REQUIRED_FIELDS = ["username"] | |
objects = CustomUserManager() | |
def __str__(self): | |
return self.email |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment