Skip to content

Instantly share code, notes, and snippets.

@vinigracindo
Created March 14, 2012 23:32
Show Gist options
  • Save vinigracindo/2040388 to your computer and use it in GitHub Desktop.
Save vinigracindo/2040388 to your computer and use it in GitHub Desktop.
From django.contrib.auth.models import User
From user_auth.models import UserSocialAuth
import facebook # (Facebook.py [3])
user = User.objects.get(id=10) # Suponha que existe um usuário 10 com facebook
access_token = UserSocialAuth.objects.get(user = user, provider = 'facebook').extra_data['access_token']
user._facebook = facebook.GraphAPI(access_token)
user.facebook
>> <facebook.GraphAPI object [...]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment