Skip to content

Instantly share code, notes, and snippets.

View noahpresler's full-sized avatar

Noah Presler noahpresler

View GitHub Profile
@rchrd2
rchrd2 / gist:6179550
Created August 7, 2013 22:39
How to link django-social-auth with google-api-python-client I am creating a gist, because this took me way to long to figure out. Maybe it can save you some time!
import httplib2
from apiclient.discovery import build
from oauth2client.client import AccessTokenCredentials
def connect_helper(user):
c = user.social_auth.get(provider='google-oauth2')
access_token = c.tokens['access_token']
credentials = AccessTokenCredentials(access_token, 'my-user-agent/1.0')
http = httplib2.Http()