daily pastebin goal
24%
SHARE
TWEET

Untitled

a guest May 31st, 2017 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # coding: utf-8
  2. from pprint import pprint
  3.  
  4. from django.contrib.auth.hashers import make_password
  5. from django.contrib.auth import get_user_model
  6.  
  7.  
  8. def foo(username):
  9.     '''Execute the password checking'''
  10.     stored_password = get_user_model().objects.get(username=username).password.split('$')
  11.     salt = stored_password[2]
  12.     evaluated_hash = make_password(username, salt=salt).split('$')
  13.  
  14.     print("STORED PASSWORD")
  15.     pprint(stored_password)
  16.     print("EVALUATED PASSWORD")
  17.     pprint(evaluated_hash)
  18.  
  19.     assert pwd.split('$')[2] == hsh.split('$')[2], "WhyOhWhyError: why oh why?"
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top