Skip to content

Instantly share code, notes, and snippets.

@toastdriven
Created June 27, 2011 19:23
Show Gist options
  • Save toastdriven/1049591 to your computer and use it in GitHub Desktop.
Save toastdriven/1049591 to your computer and use it in GitHub Desktop.
# Change this to match your user.
username = 'daniel'
from tastypie.models import ApiKey
from django.contrib.auth.models import User
my_user = User.objects.get(username=username)
key, created = ApiKey.objects.get_or_create(user=my_user)
# Now use key.key for the digest password.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment