﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
3011	Allow for extendable auth_user module	nowell strite	nobody	"I have been using the AUTH_PROFILE_MODULE setting paired with the get_profile() feature of the Django auth system and have run into many cases where it would be nice to directly access extra arbitrary user information without having to call get_profile() for each record. 

I have patched my Django installation (with the attached .diff) to allow the developer to provide their own auth_user module, with the requirement that any developer created user model contains the base fields provided by the default auth_user model. This not only allows you to continue to use the build-in Django admin modules that rely on the auth_user system, but it allows you to store information like a users address, or override the username field to accept emails, etc.

My solution to this problem involves a few things
 * Adding a settings AUTH_USER_MODULE that specifies the path to the custom auth_user model. (i.e. 'myproj.apps.users.models.User')
 * Moving the existing User class out of the ./django/contrib/auth/models.py into a subdirectory './django/contrib/auth/users/models.py' that will not automatically be registered as a model when someone adds the 'django.contrib.auth' module to their INSTALLED_APPS. The AUTH_USER_MODULE setting in global settings points to this class by default 'django.contrib.auth.users.models.!DefaultUser'
 * Creating a !UserTemplate class that every user auth system must inherit from. This ensures that the default functions (like check_password, has_permission, etc.) are available (all of which can be overridden in the custom User class."	New feature	closed	contrib.auth		Normal	fixed	auth_user	say4ne@… bram@… mike.lopez@… osborn.steven@… michael@… simon@… treborhudson@… goliath.mailinglist@… hanne.moa@… michal@… Marinho Brandão ville@… sylvaintersideral@… David Larlet dan@… waylan@… albrecht.andi@… nreilly@… tomasare@… youngj@… richard@… Sergio Oliveira Alexander Koshelev Simon Law Robin ramusus@… stv@… tinodb@… Dan Fairs miracle2k msaelices@… mmitar@… anball@… remco@… tom@… Francis Devereux Walter Doekes German M. Bravo tgecho hwaara@… chris+django@… alex@… lancelotj drdee jeverling@… honyczek@… j.arnds@… mindsocket sergzach jeroen@… Ivan Virabyan	Accepted	1	1	1	1	0	0
