In Django I implemented social login using the social auth app and I 
followed this link 
<https://hashedin.com/blog/a-guide-to-using-social-login-with-django/> to 
configure it. Goolge OAuth is working good; google-oauth2 access token is 
stored in extra data field.

Now I want to list google drive files using this access token. I tried with 
this.

def drive(request):
    user = request.user
    social = user.social_auth.get(provider='google-oauth2')
    response = requests.get(
        'https://www.googleapis.com/auth/drive.metadata.readonly',
        params={'access_token': social.extra_data['access_token']})
    print(response)
    return render(request, 'home/drive.html', {'checking':response})

I am getting a 200 response, but I don't know how to list files.

I'm using django 2.0.3 and python 3.5.


Hi
>
> Am trying to implement Google API client for Django. I am following the 
> link https://developers.google.com/api-client-library/python/guide/django 
> but it was not working. Amusing python 3.5 and Django 2.0. It is very 
> helpful if there is a new user manual to implement Django google API client.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7f7ff58d-2895-496a-ada1-d255d5f6ccf6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to