In Django
I implemented social login using the social auth app and I followed this link 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
.
--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django...@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.
If you are getting a 200 response - then the request has succeeded without any errors - therefore this is more about handilng the response from the google api.