Index: django/contrib/auth/handlers/modwsgi.py
===================================================================
--- django/contrib/auth/handlers/modwsgi.py	(revision 0)
+++ django/contrib/auth/handlers/modwsgi.py	(revision 0)
@@ -0,0 +1,38 @@
+from django.contrib.auth.models import User
+from django import db
+
+def check_password(environ, user, password, **kwargs):
+    """
+    Authentication handler that checks against Django's auth database.
+    """
+    
+    db.reset_queries()
+
+    # check that the username is valid
+    kwargs.update({'username': user, 'is_active': True})
+    try:
+        try:
+            user = User.objects.get(**kwargs)
+        except User.DoesNotExist:
+            return None
+    
+        # check the password given
+        if user.check_password(password):
+            return True
+        else:
+            return False
+    finally:
+        db.connection.close()
+    
+
+def check_staff_password(environ, user, password):
+    """
+    Authentication handler that checks against staff in Django's auth database.
+    """
+    return check_password(environ, user, password, is_staff=True)
+
+def check_superuser_password(environ, user, password):
+    """
+    Authentication handler that checks against superusers in Django's auth database.
+    """
+    return check_password(environ, user, password, is_superuser=True)
\ No newline at end of file
