PASSWORD_HASHERS = (
'myproj.drupal_hasher.DrupalPasswordHasher', #drupal hasher
'django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher',
'django.contrib.auth.hashers.BCryptPasswordHasher',
'django.contrib.auth.hashers.SHA1PasswordHasher',
'django.contrib.auth.hashers.MD5PasswordHasher',
'django.contrib.auth.hashers.CryptPasswordHasher',
)
'ascii' codec can't decode byte 0xcf in position 0: ordinal not in range(128)
Here is the trackback:
Environment:
Request Method: POST
Request URL: http://127.0.0.1:8000/auth/
Django Version: 1.7.3
Python Version: 2.7.3
Installed Applications:
('django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'article',
'photo',
'debug_toolbar',
'django_markdown',
'haystack')
Installed Middleware:
(u'debug_toolbar.middleware.DebugToolbarMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware')
Traceback:
File "/home/mario/.myprojenv/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
111. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/mario/myproj/myauth/views.py" in auth_view
16. user = auth.authenticate(username=username, password=password)
File "/home/mario/.myprojenv/local/lib/python2.7/site-packages/django/contrib/auth/__init__.py" in authenticate
60. user = backend.authenticate(**credentials)
File "/home/mario/.myprojenv/local/lib/python2.7/site-packages/django/contrib/auth/backends.py" in authenticate
17. if user.check_password(password):
File "/home/mario/.myprojenv/local/lib/python2.7/site-packages/django/contrib/auth/models.py" in check_password
237. return check_password(raw_password, self.password, setter)
File "/home/mario/.myprojenv/local/lib/python2.7/site-packages/django/contrib/auth/hashers.py" in check_password
63. setter(password)
File "/home/mario/.myprojenv/local/lib/python2.7/site-packages/django/contrib/auth/models.py" in setter
235. self.set_password(raw_password)
File "/home/mario/.myprojenv/local/lib/python2.7/site-packages/django/contrib/auth/models.py" in set_password
227. self.password = make_password(raw_password)
File "/home/mario/.myprojenv/local/lib/python2.7/site-packages/django/contrib/auth/hashers.py" in make_password
85. return hasher.encode(password, salt)
File "/home/mario/myproj/myproj/drupal_hasher.py" in encode
81. encoded_hash = self._apply_hash(password, self._digests[digest], settings)
File "/home/mario/myproj/myproj/drupal_hasher.py" in _apply_hash
68. password_hash = digest(password_hash + password).digest()
Exception Type: UnicodeDecodeError at /auth/
Exception Value: 'ascii' codec can't decode byte 0xcf in position 0: ordinal not in range(128)
Did you read the comments on that snippet? It appears there may need to be some extra encoding/decoding needed (example additional code is listed there), which would make sense given the decoding errors you are seeing.
-James
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5dd15420-01d5-4b1f-adf0-af3ee585ba73%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/SsTGFmnlNgM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2Be%2BciW9H3qLosHWPUrvC%2BZub%3DsJEXdU1-UMpkBK%2BrwKFH%2BZeA%40mail.gmail.com.