I'm trying to use different hashers with django 1.4. I have a hasher file 'hashers.py' in my app 'accounts',
import hashlib
from pbkdf2 import pbkdf2
from django.contrib.auth.hashers import SHA1PasswordHasher
from django.utils.crypto import pbkdf2
class SHA512PasswordHasher(SHA1PasswordHasher):
algorithm = "sha512"
and i added to settings,
PASSWORD_HASHERS = (
'accounts.hashers.SHA512PasswordHasher',
)
I get the following exception value,
Exception Value:
hasher not found: accounts.hashers.SHA512PasswordHasher
also, if i don't have
from pbkdf2 import pbkdf2
i get the following error,
Exception Value:
Unknown password hashing algorithm 'pbkdf2_sha256'. Did you specify it in the PASSWORD_HASHERS setting?
Even when i use any of the already written hashers in the main django library. Could be a bug?
Anyway, why is my new hasher not being found. I followed what is written in the django documentation. https://docs.djangoproject.com/en/dev/topics/auth/