[Answer]-Django-Allauth and django-facebook to retrieve Facebook profile images

1👍

The photo can be retrieved directly with the user UID and this URL:

http://graph.facebook.com/UID/picture?width=40&height=40

In function:

 fb_uid = SocialAccount.objects.filter(user_id=self.user.id, provider='facebook')

 if len(fb_uid):
         return "http://graph.facebook.com/{}/picture?width=40&height=40".format(fb_uid[0].uid)
👤Leo

0👍

I’m not entire sure, but I think you will get access to the user’s photos when you add “user_photos” to scope list in facebook configuration. Did you try it?

Here is a link to django allauth documentation: http://django-allauth.readthedocs.org/en/latest/providers.html#facebook

Leave a comment