For each user registered through a social account, an instance of SocialAccount is available. This model has a foreign key for User . Please note that a user can connect several social network accounts to his local account, so in practice several instances of SocialAccount may be available.
How you want to deal with this depends on the project. I can imagine that you want to copy the profile picture locally or perhaps want to give preference to the Google+ profile picture above Facebook, etc.
The SocialAccount model has some helper methods that give you access to the basics of an account, such as a profile picture. All in all, this is a quick and dirty way to access the first available profile picture:
{{user.socialaccount_set.all.0.get_avatar_url}}
Identifier is also available:
{{user.socialaccount_set.all.0.uid}}
See also: https://github.com/pennersr/django-allauth/blob/master/allauth/socialaccount/models.py#L72
pennersr Sep 01 2018-12-12T00: 00Z
source share