Skip to content

Instantly share code, notes, and snippets.

@joaquinacuna
Created November 4, 2020 16:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joaquinacuna/302a884547e376b49f4427f4f3430478 to your computer and use it in GitHub Desktop.
Save joaquinacuna/302a884547e376b49f4427f4f3430478 to your computer and use it in GitHub Desktop.
User model to flutter example
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