Abstract models + utils to replace django.contrib.auth.User
with a model that uses an email
address instead of a username.
pip install django-email-user
# my_auth/models.py
from email_user.models import EmailBasedUser
class User(EmailBasedUser):
pass
# my_auth/admin.py
from email_user.admin import EmailBasedUserAdmin
from django.contrib.admin import register
from . import models
@register(models.User)
class UserAdmin(EmailBasedUserAdmin):
pass
# in project settings
INSTALLED_APPS = (
# '...',
'my_auth',
)
AUTH_USER_MODEL = 'my_auth.User'
This codebase is largely derived from django-generic and django-polymorphic-auth.