Skip to content

Instantly share code, notes, and snippets.

@oguya
Created December 5, 2013 12:25
Show Gist options
  • Save oguya/7804409 to your computer and use it in GitHub Desktop.
Save oguya/7804409 to your computer and use it in GitHub Desktop.
get userid without using request object
from django.contrib.auth.models import User
User.objects.get(username=the_username).pk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment