Hide Auth section in Django Admin [duplicate]

2019-03-17 10:07发布

This question already has an answer here:

In the Django Admin, is there any way to hide the "Auth" section? Assuming this is a clean installation of Django and barebones project with no apps, only admin.

1条回答
Fickle 薄情
2楼-- · 2019-03-17 10:30

You can use admin.site.unregister

from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from django.contrib.auth.models import Group

admin.site.unregister(User)
admin.site.unregister(Group)
admin.site.unregister(Site)
查看更多
登录 后发表回答