在Django Admin中隐藏Auth部分 [英] Hide Auth section in Django Admin

查看:291
本文介绍了在Django Admin中隐藏Auth部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Django管理员中,有没有办法隐藏Auth部分?假设这是一个干净安装的Django和准系统项目,没有应用程序,只有管理员。

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.

推荐答案

您可以使用 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)

这篇关于在Django Admin中隐藏Auth部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆