a guest May 31st, 2017 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- # coding: utf-8
- from pprint import pprint
- from django.contrib.auth.hashers import make_password
- from django.contrib.auth import get_user_model
- def foo(username):
- '''Execute the password checking'''
- stored_password = get_user_model().objects.get(username=username).password.split('$')
- salt = stored_password
- evaluated_hash = make_password(username, salt=salt).split('$')
- print("STORED PASSWORD")
- print("EVALUATED PASSWORD")
- assert pwd.split('$') == hsh.split('$'), "WhyOhWhyError: why oh why?"
RAW Paste Data