Skip to content

Instantly share code, notes, and snippets.

@rgegriff
Created August 1, 2016 21:32
Show Gist options
  • Save rgegriff/f7196c63b431695df3ec5ea5610bd3f4 to your computer and use it in GitHub Desktop.
Save rgegriff/f7196c63b431695df3ec5ea5610bd3f4 to your computer and use it in GitHub Desktop.
Impersonate python sessions
email = "User@email.com"
user = User.objects.get(email__icontains=email)
[s for s in Session.objects.all() if "_auth_user_id" in s.get_decoded() and int(s.get_decoded()['_auth_user_id']) == user.id]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment