Seamless email authentication for Django
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.



emailauth provides seamless email-based authentication for Django. It leverages Django's own contrib.auth package, extending where appropriate.


emailauth requires Django 1.5 or newer and Python 2.6/3.2 or newer.

How to install

Using pip:

$ pip install git+


$ git clone
$ cd django-emailauth
$ python install

How to use

Make sure you have django.contrib.auth and django.contrib.contenttypes in your INSTALLED_APPS. (See the Django documentation for more details).

Add emailauth to your INSTALLED_APPS:

    # ...

    # ...

Order does not matter.

Set AUTH_USER_MODEL in your settings:

AUTH_USER_MODEL = 'emailauth.User'

It's important to note that you must set AUTH_USER_MODEL before creating any migrations or running migrate for the first time.

Run migrate to create the database tables:

$ python migrate emailauth

You're done. Remember to always use get_user_model() when you need to reference the user model.

Extending emailauth

emailauth can be used either standalone as a direct replacement of django.contrib.auth as described, or as a base to assist you with boilerplate in order to implement your own email-based user model.

emailauth provides both an abstract and a concrete user model. If you want to create your own email-based user model you should subclass emailauth.models.AbstractUser. For example, to add a phone field to your user, you might do something like the following:

from django.db import models
from emailauth.models import AbstractUser

class User(AbstractUser):
    phone = models.CharField(max_length=15, blank=True)

Remember to change AUTH_USER_MODEL to your user model in order to be picked up by Django:

AUTH_USER_MODEL = 'myapp.User'