Ticket #18118: 18118.diff

File 18118.diff, 2.0 KB (added by Claude Paroz, 13 years ago)

Updated hashers utility functions documentation

  • docs/topics/auth.txt

    diff --git a/docs/topics/auth.txt b/docs/topics/auth.txt
    index 1e73abd..1b97c68 100644
    a b checking passwords stored with PBKDF2SHA1, bcrypt_, SHA1_, etc. The next few  
    427427sections describe a couple of common ways advanced users may want to modify this
    428428setting.
    429429
     430.. _bcrypt_usage:
     431
    430432Using bcrypt with Django
    431433~~~~~~~~~~~~~~~~~~~~~~~~
    432434
    Manually managing a user's password  
    772774    to create and validate hashed password. You can use them independently
    773775    from the ``User`` model.
    774776
    775 .. function:: check_password()
     777.. function:: check_password(password, encoded)
    776778
    777779    .. versionadded:: 1.4
    778780
    Manually managing a user's password  
    783785    user's ``password`` field in the database to check against, and returns
    784786    ``True`` if they match, ``False`` otherwise.
    785787
    786 .. function:: make_password()
     788.. function:: make_password(password[, salt, hashers])
    787789
    788790    .. versionadded:: 1.4
    789791
    790792    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
    794800    ``None``, an unusable password is returned (a one that will be never
    795801    accepted by :func:`django.contrib.auth.hashers.check_password`).
    796802
    797 .. function:: is_password_usable()
     803.. function:: is_password_usable(encoded_password)
    798804
    799805   .. versionadded:: 1.4
    800806
Back to Top