Slide 25
Slide 25 text
A better way
from django.contrib.auth.models import AbstractBaseUser
class User(AbstractBaseUser):
email = models.EmailField(_('email address'), max_length=254, unique=True)
first_name = models.CharField(_('first name'), max_length=30, blank=True)
last_name = models.CharField(_('last name'), max_length=30, blank=True)
is_confirmed = models.BooleanField(default=False)
title = models.CharField(max_length=32, blank=True, null=True)
timezone = models.CharField(max_length=30, default='UTC', choices=TZ_CHOICES)
USERNAME_FIELD = 'email'
class Meta:
db_table = 'users'