Skip to content

Instantly share code, notes, and snippets.

@Liano-HyperionDev
Last active August 27, 2024 10:01
Show Gist options
  • Save Liano-HyperionDev/37c2524683a300a221534b9f2675c5e6 to your computer and use it in GitHub Desktop.
Save Liano-HyperionDev/37c2524683a300a221534b9f2675c5e6 to your computer and use it in GitHub Desktop.
Custom User Model for Django
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