Skip to content

Instantly share code, notes, and snippets.

@oguya
Created December 5, 2013 12:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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