Use Argon2 Password Hasher
A snippet showing how to enable Argon2 password hashing in Django.
pip install argon2-cffi
# settings.py
PASSWORD_HASHERS = [
'django.contrib.auth.hashers.Argon2PasswordHasher',
'django.contrib.auth.hashers.PBKDF2PasswordHasher',
'django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher',
'django.contrib.auth.hashers.BCryptSHA256PasswordHasher',
]
Explanation:
- Argon2 provides stronger password security than default PBKDF2.
- PBKDF2SHA1PasswordHasher is deprecated in favor of PBKDF2PasswordHasher.
- Argon2PasswordHasher is the default password hasher in Django 6.0.
- Category Security
- Total Views 1056
- Last Modified 02 March, 2026
- Tags #security #password #argon2 #hashing
Previous snippet
Clickjacking Protection
Next snippet