I'm starting a project with Django and I'm trying to allow users log in with Facebook. For the site purposes, I want to store the user likes in my database.
I took as an example the example app on Python Social Auth (the library I'm using for the project) and I've written a pipeline for storing data in DB.
The problem comes when I try to access likes, because the data that the response I get just gives me the basic data, so the following code doesn't work.
def user_details(strategy, details, response, user=None, *args, **kwargs):
attrs = {'user': user}
if strategy.backend.__class__.__name__ == 'FacebookOAuth2':
#no response['likes']
for i in response['likes']:
for d in i['data']:
p = UserPreferences(user=user,like=d['name'])
p.save()
My app in Facebook asks for likes permissions, and I have the following on my settings.py (with the secret and all that stuff):
SOCIAL_AUTH_SCOPE = ['user_likes']
Any way to make this work?