How can I retrieve profile picture and date of birth from google and facebook using python-social-auth by extending pipeline? I've read that I can make functions to do so and set path to them but I don't know the attribute names that I must retrieve. Please help!
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Django __str__ returned non-string (type NoneType)
- Evil ctypes hack in python
Here's what I have used to save pictures for Facebook:
Save this function into a file, for instance, pipelines.py, and then add the function to your SOCIAL_AUTH_PIPELINE in your settings.
For Facebook you need to create your own Facebook app. You can only retrieve information and pictures from users who have given you the permission to do so. Same rules more or less apply for Google. Read their API docs for more detail.
To get avatars from social login, you need create a pipeline.py file in your app and add this lines to settings.py:
and later add this content to your pipeline.py file