Index: django/contrib/auth/models.py
===================================================================
--- django/contrib/auth/models.py	(revision 6710)
+++ django/contrib/auth/models.py	(working copy)
@@ -19,10 +19,10 @@
 def get_hexdigest(algorithm, salt, raw_password):
     """
     Returns a string of the hexdigest of the given plaintext password and salt
-    using the given algorithm ('md5', 'sha1' or 'crypt').
+    using the given algorithm ('md5', 'sha1', 'crypt' or 'md5-crypt').
     """
     raw_password, salt = smart_str(raw_password), smart_str(salt)
-    if algorithm == 'crypt':
+    if algorithm in ('crypt', 'md5-crypt'):
         try:
             import crypt
         except ImportError:
@@ -51,7 +51,11 @@
     Returns a boolean of whether the raw_password was correct. Handles
     encryption formats behind the scenes.
     """
-    algo, salt, hsh = enc_password.split('$')
+    algo, salt_and_hash = enc_password.split('$', 1)
+    if algo in ('md5-crypt', 'crypt') and salt_and_hash.startswith('$1'):
+        salt = hsh = salt_and_hash
+    else:
+        salt, hsh = salt_and_hash.rsplit('$', 1)
     return hsh == get_hexdigest(algo, salt, raw_password)
 
 class SiteProfileNotAvailable(Exception):
