Last active
August 27, 2024 10:01
-
-
Save Liano-HyperionDev/37c2524683a300a221534b9f2675c5e6 to your computer and use it in GitHub Desktop.
Custom User Model for Django
This file contains hidden or 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
from django.db import models | |
from django.contrib.auth.models import AbstractUser | |
class CustomUser(AbstractUser): | |
username = models.CharField( | |
max_length=200, | |
unique=True, | |
help_text='Required. Letters, digits, and spaces only.', | |
validators=[], | |
error_messages={ | |
'unique': "That username is taken. Please try another username.", | |
}, | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment