Skip to main content

django-email-login

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

https://travis-ci.org/futurecolors/django-email-login.png?branch=master https://coveralls.io/repos/futurecolors/django-email-login/badge.png?branch=master

Goals

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

Install with pip install django-email-login or checkout from Bitbucket hg clone https://bitbucket.org/tino/django-email-login and run python setup.py install.

Usage

  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 urls.py 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 = admin.site._registry
  4. Instead of using:

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

    use:

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

    to include the admin in your root urls.py.

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

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

    to your urls.py

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 useradmin.py 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')}
        ),
    )

admin.site.unregister(User)
admin.site.register(User, MyUserAdmin)

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

Release files for django-email-login-fc 0.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-email-login-fc 0.3.2
File Size Uploaded
django-email-login-fc-0.3.2.zip 19.0 kB Details

Release files / django-email-login-fc-0.3.2.zip

Download URL django-email-login-fc-0.3.2.zip
Size 19.0 kB
Tags Source
SHA-256 checksum
How to use checksums
5c28e1dc29c8e00a85f43af5e83a61a9d2bfe2bd33b90ff653094f82536b12e4
BLAKE2b-256 checksum
How to use checksums
a6dc70a6a551332d71651bd7b9c762c7f052c7abdb879073c5277ec75745d582
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.3.2 This release

1 release file

0.3.1

1 release file

0.3.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page