How to hide/unregister the Accounts and Social accounts created by django-allauth from django admin?

Viewed 536

I am beginner to django and i wanted to try google authentication and when i followed the steps from here i am able to sucessfully add a google login button but it also showing the ACCOUNTS and Social Accounts in django admin. How can i hide them ? I tried unregistering them but it always giving error thats its not registerd. enter image description here

2 Answers

put this code in the end of project/urls.py

from django.contrib import admin
from allauth.socialaccount.models import SocialToken, SocialAccount, SocialApp

admin.site.unregister(SocialToken)
admin.site.unregister(SocialAccount)
admin.site.unregister(SocialApp)

To unregister Accounts, it worked for me to use the following code. I placed it in the admin.py file of one of my apps.

from allauth.account.models import EmailAddress

admin.site.unregister(EmailAddress)
Related