I need to import a list of users and hashed passwords from an old PHP site that used password_hash() to a new django site. The stored passwords look like this: $2y$10$ZnxKDPbqOfACnGmQeN76o.UtdwWBFBCCLTiGnvCSvl/zqIBeVxhai
I found Django password hasher using php format of function password_hash() on here when trying to look this up, and I think that will help for the NEXT step.
But currently I can't setup an import process that will correctly bring over the old passwords. When I try to manually create the users during the import process it refuses the password stating "Invalid password format or unknown hashing algorithm." when I look at the users after the import runs. I think I am just going about this totally incorrectly, here is an example snippet where I create the users.
usertest = User(username='testguy',email='testguy@test.com',password='$2y$10$ZnxKDPbqOfACnGmQeN76o.UtdwWBFBCCLTiGnvCSvl/zqIBeVxhai')
That results in no password being store. Using the create_user function results in the user being created but with that hashed password output as their password:
User.objects.create_user(username='testguy',email='testguy@test.com',password='$2y$10$ZnxKDPbqOfACnGmQeN76o.UtdwWBFBCCLTiGnvCSvl/zqIBeVxhai')
How can I just get these passwords stored properly in the new database so I can move onto the next step of actually checking against those passwords?