Index: django/conf/global_settings.py
===================================================================
--- django/conf/global_settings.py	(revision 10115)
+++ django/conf/global_settings.py	(working copy)
@@ -379,6 +379,9 @@
 # The number of days a password reset link is valid for
 PASSWORD_RESET_TIMEOUT_DAYS = 3
 
+# The class to use as the default AUTH_USER for the authentication system. 
+AUTH_USER_MODULE = None 
+
 ###########
 # TESTING #
 ###########
Index: django/contrib/auth/models.py
===================================================================
--- django/contrib/auth/models.py	(revision 10115)
+++ django/contrib/auth/models.py	(working copy)
@@ -1,6 +1,7 @@
 import datetime
 import urllib
 
+from django.conf import settings
 from django.contrib import auth
 from django.core.exceptions import ImproperlyConfigured
 from django.db import models
@@ -119,7 +120,7 @@
         from random import choice
         return ''.join([choice(allowed_chars) for i in range(length)])
 
-class User(models.Model):
+class UserTemplate(models.Model):
     """Users within the Django authentication system are represented by this model.
 
     Username and password are required. Other fields are optional.
@@ -142,6 +143,7 @@
     class Meta:
         verbose_name = _('user')
         verbose_name_plural = _('users')
+        abstract = True
 
     def __unicode__(self):
         return self.username
@@ -287,6 +289,34 @@
                 raise SiteProfileNotAvailable
         return self._profile_cache
 
+if settings.AUTH_USER_MODULE is not None:
+    # Grab the AUTH_USER_MODULE path and classname from the settings.  
+    # auth_user_module_parts[0] = module path  
+    # auth_user_module_parts[1] = class name  
+    auth_user_module_parts = settings.AUTH_USER_MODULE.rsplit('.', 1)  
+    auth_user_module = __import__(auth_user_module_parts[0], {}, {}, [auth_user_module_parts[0]])  
+    # Store the auth_user model so it is accessible with the standard  
+    # 'from django.contrib.auth.models import User'  
+    User = getattr(auth_user_module, auth_user_module_parts[1])  
+
+    # Add te User model to the django models cache  
+    # These two lines allow the custom auth_user model to play nicely with syncdb  
+    # and other systems that rely on functions like  
+    # django.db.models.loading.get_model(...)  
+    from django.db.models.loading import cache  
+    cache.register_models('auth', User) 
+     
+    # We need to remove whatever we used as the AUTH_USER_MODUlE from the 
+    # db cache so apps like contenttypes don't think that it's part 
+    # of contrib.auth 
+    del cache.app_models['auth'][auth_user_module_parts[1].lower()] 
+else:
+    class User(UserTemplate):
+        class Meta:
+            verbose_name = _('user')
+            verbose_name_plural = _('users')
+     
+
 class Message(models.Model):
     """
     The message system is a lightweight way to queue messages for given
