Custom user model app for Django featuring email as username and class-based views for authentication.
A custom user model app for Django 1.8+ that features email as username and other things. It tries to stay true to the built-in user model for the most part.
The main differences between authtools’s User and django.contrib.auth’s are email as username and class-based auth views.
Read the django-authtools documentation.
Before you use this, you should probably read the documentation about custom User models.
Install the package:
$ pip install django-authtools
Add authtools to your INSTALLED_APPS.
Add the following to your settings.py:
AUTH_USER_MODEL = 'authtools.User'
Add authtools.urls to your URL patterns:
urlpatterns = patterns('', # ... url(r'^accounts/', include('authtools.urls')), # ... )
Added Django 1.7 compatibility (Antoine Catton, Rocky Meza, #35)
LoginView.disallow_authenticated was changed to LoginView.allow_authenticated
LoginView.disallow_authenticated was deprecated.
Backwards Incompatible: LoginView.allow_authenticated is now True by default (which is the default behavior in Django)
Create migrations for authtools.
If updating from an older authtools, these migrations must be run on your apps:
$ python manage.py migrate --fake authtools 0001_initial $ python manage.py migrate
Django 1.6 support.
Django 1.6 broke backwards compatibility of the password_reset_confirm view. Be sure to update any references to this URL. Rather than using a separate view for each encoding, authtools uses a single view that works with both.
Bugfix: if LOGIN_URL was a URL name, it wasn’t being reversed in the PasswordResetConfirmView.