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 1060
  • Last Modified 02 March, 2026
  • Tags #security #password #argon2 #hashing
Never miss a story on Django.wiki

Subscribe for fresh tutorials, snippets, and updates.

By subscribing you agree to our Privacy Policy.