how to get user email with python social auth with facebook and save it how to get user email with python social auth with facebook and save it django django

how to get user email with python social auth with facebook and save it


After some changes in Facebook Login API - Facebook's Graph API v2.4You will have to add these lines to fetch email

SOCIAL_AUTH_FACEBOOK_SCOPE = ['email']SOCIAL_AUTH_FACEBOOK_PROFILE_EXTRA_PARAMS = {    'fields': 'id,name,email', }


I think the problem is using FACEBOOK_EXTENDED_PERMISSIONS.

According to http://python-social-auth.readthedocs.org/en/latest/backends/facebook.html#oauth2 you should use:

SOCIAL_AUTH_FACEBOOK_SCOPE = ['email']


Add this to your settings.py file

SOCIAL_AUTH_FACEBOOK_SCOPE = ['email']