gpt4 book ai didi

django - django 中的员工、管理员、 super 用户之间有什么区别?

转载 作者:行者123 更新时间:2023-11-28 19:35:00 32 4
gpt4 key购买 nike

Django 有 super 用户、职员、管理员……

super 用户和员工在 django.contib.auth.models.UserManager 中。然后是django-admincreatesuperuser命令。

好吧,有管理应用程序……有什么区别?

最佳答案

我从 Django Documentation 中获取这个:

One of the most powerful parts of Django is the automatic admininterface. Best thing is that you can customise it easily.

If logged in as a superuser, you have access to create, edit, anddelete any object (models).

You can create staff user using staff flag. The “staff” flag controlswhether the user is allowed to log in to the admin interface (i.e.,whether that user is considered a “staff member” in yourorganization). Since this same user system can be used to controlaccess to public (i.e., non-admin) sites, this flag differentiatesbetween public users and administrators.

“Normal” admin users – that is, active, non-superuser staff members –are granted admin access through assigned permissions. Each objecteditable through the admin interface has three permissions: a createpermission, an edit permission and a delete permission for all themodels you had created.

Django’s admin site uses a permissions system that you can use to givespecific users access only to the portions of the interface that theyneed. When you create a user, that user has no permissions, and it’sup to you to give the user specific permission

关于django - django 中的员工、管理员、 super 用户之间有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20469174/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com