Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

hide django-allauth model from admin page

I want hide all django-allauth model from admin page

enter image description here

after I see the source code in github I see it use three models SocialAccount, SocialToken and SocialApp.

now I use this to hide model from admin page and it works when I try to use it on my own model but when I use it to hide django-allauth model it doesnt work, I think I stuck on the part from x import SocialAccount, SocialToken, SocialApp

because the error message is always like this

ImportError: cannot import name 'SocialAccount' from 'x'

I dont know the x part what to import, where to import

like image 691
Duck Yeah Avatar asked Sep 16 '25 13:09

Duck Yeah


1 Answers

this works.

from allauth.socialaccount.models import SocialAccount, SocialApp, SocialToken

admin.site.unregister(SocialAccount)
admin.site.unregister(SocialApp)
admin.site.unregister(SocialToken)
like image 192
w-tiger Avatar answered Sep 19 '25 03:09

w-tiger