Many thanks for your help Thomas. Indeed I am in the middle of big escape 
effort to get the heck away from Drupal.

I tested your snippet in the shell and DrupalPasswordHasher hashes 
perfectly well there. 

However, when I integrate the hash into my project as per your explanation, 
django-registration module still refuse to authenticate old drupal users. 

Any ideas on how to troubleshoot this?
 
Cheers

On Thursday, January 22, 2015 at 4:12:07 AM UTC+1, Thomas wrote:
>
> On Jan 21, 2015, at 3:07 PM, Supermario <huma...@gmail.com <javascript:>> 
> wrote:
>
> I am trying to move Druap 7 site to django 1.7 without invalidating user 
> passwords, and this proved to be daunting.
>
> Fortunately, I have found this 
> <http://stackoverflow.com/questions/9876700/migrate-passwords-from-drupal-7-to-django>
>  SO 
> question and this <https://djangosnippets.org/snippets/3030/> hashing 
> snippet but there is no documentation and as a newbie to django, I have no 
> clue how to integrate the snippet into my project.
>
>
> I’ve enclosed a password processor I used in the past for a Drupal 
> conversion; the gist came from a web search and is attributed in the code 
> but has some minor fixes. I’ve actually included two processors, with one 
> disabled with “XXX” in the function name. I think I had trouble getting 
> that one to work.
>
> You can create a “drupal” app, which just has an __init__.py and this file 
> as hashers.py
>
> You will want to add “drupal” as one of your apps, then also define the 
> following in your settings.py:
>
> PASSWORD_HASHERS = (
>     'django.contrib.auth.hashers.PBKDF2PasswordHasher',
>     'drupal.hashers.DrupalPasswordHasher',
>     'django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher',
>     'django.contrib.auth.hashers.BCryptPasswordHasher',
> )
>
> Since you are starting fresh, you can include only the recommended best 
> password hasher from Django plus the drupal hasher. And if you prefer you 
> could fold the hashers.py file into another existing app in your project.
>
> Also, the structure of your project may be a bit different from mine since 
> the recommended Django layout has changed a bit over the last few versions.
>
> hth, and enjoy getting the heck away from Drupal hell…
>
> - Tom
>
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/aa905c13-b9b1-42ba-b0c2-4127d079a8c3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to