Duck Yeah
Duck Yeah

Reputation: 79

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

Upvotes: 4

Views: 433

Answers (1)

w-tiger
w-tiger

Reputation: 56

this works.

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

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

Upvotes: 4

Related Questions