0

I want to access the extra-data dictionary provided by SocialAccount. I need to store the family name of the user in a variable. I have attached the the code below. The following code throws an error:

name 'SocialAccount' is not defined.

I saw this on Django allauth Social application extra data.

data=SocialAccount.objects.get(user=request.user).extra_data
        follows=data.get('family_name')
        return render(request, 'main/index.html', {"name":follows})

How do I fix this?

He3lixxx
  • 3,263
  • 1
  • 12
  • 31
Anshuman Verma
  • 105
  • 1
  • 1
  • 8

1 Answers1

1

I figured out the missing import:

from allauth.socialaccount.models import SocialAccount
He3lixxx
  • 3,263
  • 1
  • 12
  • 31
Anshuman Verma
  • 105
  • 1
  • 1
  • 8