LoginSignup
0
2

More than 1 year has passed since last update.

【Django】パスワードのハッシュ化

Posted at

settings.py の PASSWORD_HASHERS 変数を追加する

Djangoで使えるhasherは以下のURLを参照。
https://docs.djangoproject.com/ja/3.1/topics/auth/passwords/#included-hashers

そこからいくつか選んで以下のようにsettings.pyに追加する。今回はBcrypt, Argon2, PBKDF2にした例です。

PASSWORD_HASHERS = [
    'django.contrib.auth.hashers.Argon2PasswordHasher',
    'django.contrib.auth.hashers.BCryptSHA256PasswordHasher',
    'django.contrib.auth.hashers.BCryptPasswordHasher',
    'django.contrib.auth.hashers.PBKDF2PasswordHasher',
    'django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher',
]
0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2