Created
November 4, 2020 16:04
-
-
Save joaquinacuna/302a884547e376b49f4427f4f3430478 to your computer and use it in GitHub Desktop.
User model to flutter example
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
from django.db import models | |
# Create your models here. | |
from django.contrib.auth.models import AbstractUser | |
class CustomUser(AbstractUser): | |
EMAIL_FIELD = 'email' | |
USERNAME_FIELD = 'email' | |
REQUIRED_FIELDS = ['username'] | |
username= models.CharField(blank=True, max_length=254,) | |
email = models.EmailField(blank=False, max_length=254, unique=True, verbose_name="email address") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment