예제 #1
0
def get_gmail_service(user):

    storage = Storage(CredentialsModel, 'id', user, 'credential')
    credential = storage.locked_get()
    http = httplib2.Http()
    if credential.refresh_token == None:
        return None
    http = credential.authorize(http)
    gmail_service = build("gmail", "v1", http=http)
    return gmail_service
예제 #2
0
def get_storage(user):
    storage = Storage(CredentialsModel, 'id', user, 'credential')
    credential = storage.locked_get()
    return render_to_response('mailage/created.html', {'message': inspect.getmembers(credential)})