Skip to main content
Help us improve PyPI by participating in user testing. All experience levels needed!

A Django application that enables you to have your users use their email address instead of their username

Project description


Log in via email for django 1.4. Forked from django-email-login


The goal of this app is to easily transform django’s auth system to allow login with an email adress, instead of a username. This should work inside the admin as well as outside. Therefore, email adresses need to be unique.

The username of the User will be the hash of it’s email adress. As it means nothing, it will be hidden in the admin changelist view.


Install with pip install django-email-login or checkout from Bitbucket hg clone and run python install.


  1. Append 'email_login' to your INSTALLED_APPS setting

  2. Insert 'email_login.auth_backend.EmailBackend' as first in the AUTHENTICATION_BACKENDS settings tuple.

  3. Add the following in you root after admin.autodiscover():

    # Insert email_login overrides
    from email_login import useradmin, adminsite
    site = adminsite.EmailLoginAdminSite()
    # duplicate the normal admin's registry until ticket #8500 get's fixed
    site._registry =
  4. Instead of using:

    # Uncomment the next line to enable the admin:
    (r'^admin/', include(,


    # Uncomment the next line to enable the admin:
    (r'^admin/', include(site.urls)),

    to include the admin in your root

  5. To use login outside of the admin, add:

    (r'^account/', include('email_login.urls')),

    to your


Your admin account needs to have an email address, otherwise you won’t be able to sign in!


The admin will display the username in the top right corner of the logged in user if the user has no firstname. If you want to override that, over- ride the admin/base.html template.

In conjunction with django-user-creation

If you want to use this app in conjunction with django-user-creation, you have to create your own ModelAdmin for User. You may do so by adding a file to your project with the following contents:

from django.contrib import admin
from django.contrib.auth.models import User
from user_creation.forms import EmailAccountCreationForm
from email_login.useradmin import EmailLoginAdmin

class MyUserAdmin(EmailLoginAdmin):
    add_form = EmailAccountCreationForm
    add_fieldsets = (
        (None, {
            'classes': ('wide',),
            'fields': ('email', 'password1', 'password2', 'email_user')}
    ), MyUserAdmin)

and adding the line import useradmin to your after the overrides described above.

Project details

Release history Release notifications

This version
History Node


History Node


History Node


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date (19.0 kB) Copy SHA256 hash SHA256 Source None Apr 23, 2013

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page