1

so I have set up Django allauth on my Django project and connected to Instagram, when doing so I have now on my admin site Social accounts category with my account registers, all good so far

on the lower page, I can see a field called extra data, how can I put it inside the normal Users database so I can use it to take how many followers I got out of the extra data? can I request the followers with the Token i have maybe?

enter image description here

1 Answers1

3

You can simply access the SocialAccount model like any other django model:

from allauth.socialaccount.models import SocialAccount

def instagram(request):
    data = SocialAccount.objects.get(user=request.user).extra_data
    follows = data.get('counts')
    return render(request, 'Path.to.html', {"follows": follows})
He3lixxx
  • 3,263
  • 1
  • 12
  • 31