1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Refs #20910 -- Replaced snippet directive with code-block.

This commit is contained in:
Curtis Maloney
2018-09-11 03:00:34 +10:00
committed by Tim Graham
parent f8ff529ee3
commit c49ea6f591
32 changed files with 234 additions and 375 deletions

View File

@@ -251,8 +251,8 @@ modify the pattern to work with any algorithm or with a custom user model.
First, we'll add the custom hasher:
.. snippet::
:filename: accounts/hashers.py
.. code-block:: python
:caption: accounts/hashers.py
from django.contrib.auth.hashers import (
PBKDF2PasswordHasher, SHA1PasswordHasher,
@@ -271,8 +271,8 @@ First, we'll add the custom hasher:
The data migration might look something like:
.. snippet::
:filename: accounts/migrations/0002_migrate_sha1_passwords.py
.. code-block:: python
:caption: accounts/migrations/0002_migrate_sha1_passwords.py
from django.db import migrations
@@ -306,8 +306,8 @@ several thousand users, depending on the speed of your hardware.
Finally, we'll add a :setting:`PASSWORD_HASHERS` setting:
.. snippet::
:filename: mysite/settings.py
.. code-block:: python
:caption: mysite/settings.py
PASSWORD_HASHERS = [
'django.contrib.auth.hashers.PBKDF2PasswordHasher',