Guest User

Untitled

a guest
Jul 18th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. from django.contrib.auth import authenticate
  2. user = authenticate(username='john', password='secret')
  3. if user is not None:
  4. if user.is_active:
  5. print "You provided a correct username and password!"
  6. else:
  7. print "Your account has been disabled!"
  8. else:
  9. print "Your username and password were incorrect."
Add Comment
Please, Sign In to add comment