我想从管理页面隐藏所有 django-allauth
模型
在我看到github中的源代码之后我看到它使用三种模型 SocialAccount
、SocialToken
和 SocialApp
。
现在我使用 this从管理页面隐藏模型,当我尝试在我自己的模型上使用它时它可以工作但是
当我用它来隐藏 django-allauth
模型时它不起作用,我想我停留在 from x import SocialAccount, SocialToken, SocialApp
因为错误信息总是这样
ImportError: cannot import name 'SocialAccount' from 'x'
我不知道x
部分要导入什么,导入哪里
最佳答案
这有效。
from allauth.socialaccount.models import SocialAccount, SocialApp, SocialToken
admin.site.unregister(SocialAccount)
admin.site.unregister(SocialApp)
admin.site.unregister(SocialToken)
关于python - 从管理页面隐藏 django-allauth 模型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65412702/