Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #18118 -- Improved documentation for contrib.auth.hashers utili…

…ty functions. Thanks Mathieu Agopian for the report and Ramiro Morales for the review.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17905 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 57a12ca0ac1bd6f6650d6f45852dd2e0fe6bec0c 1 parent 2cd5160
Claude Paroz authored April 13, 2012

Showing 1 changed file with 12 additions and 6 deletions. Show diff stats Hide diff stats

  1. 18  docs/topics/auth.txt
18  docs/topics/auth.txt
@@ -427,6 +427,8 @@ checking passwords stored with PBKDF2SHA1, bcrypt_, SHA1_, etc. The next few
427 427
 sections describe a couple of common ways advanced users may want to modify this
428 428
 setting.
429 429
 
  430
+.. _bcrypt_usage:
  431
+
430 432
 Using bcrypt with Django
431 433
 ~~~~~~~~~~~~~~~~~~~~~~~~
432 434
 
@@ -772,7 +774,7 @@ Manually managing a user's password
772 774
     to create and validate hashed password. You can use them independently
773 775
     from the ``User`` model.
774 776
 
775  
-.. function:: check_password()
  777
+.. function:: check_password(password, encoded)
776 778
 
777 779
     .. versionadded:: 1.4
778 780
 
@@ -783,18 +785,22 @@ Manually managing a user's password
783 785
     user's ``password`` field in the database to check against, and returns
784 786
     ``True`` if they match, ``False`` otherwise.
785 787
 
786  
-.. function:: make_password()
  788
+.. function:: make_password(password[, salt, hashers])
787 789
 
788 790
     .. versionadded:: 1.4
789 791
 
790 792
     Creates a hashed password in the format used by this application. It takes
791  
-    two arguments: hashing algorithm to use and the password in plain-text.
792  
-    Currently supported algorithms are: ``'sha1'``, ``'md5'`` and ``'crypt'``
793  
-    if you have the ``crypt`` library installed. If the second argument is
  793
+    one mandatory argument: the password in plain-text. Optionally, you can
  794
+    provide a salt and a hashing algorithm to use, if you don't want to use the
  795
+    defaults (first entry of ``PASSWORD_HASHERS`` setting).
  796
+    Currently supported algorithms are: ``'pbkdf2_sha256'``, ``'pbkdf2_sha1'``,
  797
+    ``'bcrypt'`` (see :ref:`bcrypt_usage`), ``'sha1'``, ``'md5'``,
  798
+    ``'unsalted_md5'`` (only for backward compatibility) and ``'crypt'``
  799
+    if you have the ``crypt`` library installed. If the password argument is
794 800
     ``None``, an unusable password is returned (a one that will be never
795 801
     accepted by :func:`django.contrib.auth.hashers.check_password`).
796 802
 
797  
-.. function:: is_password_usable()
  803
+.. function:: is_password_usable(encoded_password)
798 804
 
799 805
    .. versionadded:: 1.4
800 806
 

0 notes on commit 57a12ca

Please sign in to comment.
Something went wrong with that request. Please try again.