Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install django-email-login

How to install django-email-login

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install django-email-login
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
0.2.2
0.2.3Never BuiltWhy not?
0.2.2 Available View build log
0.2.1 Available View build log
Windows (64-bit)
0.2.2
0.2.3Never BuiltWhy not?
0.2.2 Available View build log
0.2.1 Available View build log
Mac OS X (10.5+)
0.2.2
0.2.3Never BuiltWhy not?
0.2.2 Available View build log
0.2.1 Available View build log
Linux (32-bit)
0.2.2
0.2.3Never BuiltWhy not?
0.2.2 Available View build log
0.2.1 Available View build log
Linux (64-bit)
0.2.3 Available View build log
0.2.2 Available View build log
0.2.1 Available View build log
 
License
MIT License
Imports
Lastest release
version 0.2.3 on Jan 9th, 2014

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

System Message: WARNING/2 (<string>, line 24)

Enumerated list ends without a blank line; unexpected unindent.

#. Insert 'email_login.auth_backend.EmailBackend' as first in the AUTHENTICATION_BACKENDS settings tuple. #. Add the following in you root urls.py after admin.autodiscover():

# Insert email_login overrides

System Message: ERROR/3 (<string>, line 29)

Inconsistent literal block quoting.

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

  1. Instead of using:

    System Message: WARNING/2 (<string>, line 36)

    Literal block expected; none found.

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

use:

# Uncomment the next line to enable the admin:

System Message: ERROR/3 (<string>, line 42)

Inconsistent literal block quoting.

(r'^admin/', include(site.urls)),

to include the admin in your root urls.py.

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

    System Message: WARNING/2 (<string>, line 48)

    Literal block expected; none found.

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

to your urls.py

System Message: ERROR/3 (<string>, line 52)

Content block expected for the "note" directive; none found.

.. note::

System Message: WARNING/2 (<string>, line 53)

Explicit markup ends without a blank line; unexpected unindent.

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

System Message: ERROR/3 (<string>, line 56)

Content block expected for the "note" directive; none found.

.. note::

System Message: WARNING/2 (<string>, line 57)

Explicit markup ends without a blank line; unexpected unindent.

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 useradmin.py file to your project with the following contents:

System Message: WARNING/2 (<string>, line 68)

Literal block expected; none found.

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.

Subscribe to package updates

Last updated Jan 9th, 2014

Download Stats

Last month:2

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.