django的工作人员,管理员,超级用户有什么区别? [英] What's the difference between staff, admin, superuser in django?

查看:1912
本文介绍了django的工作人员,管理员,超级用户有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Django有超级用户,员工,管理员...



超级用户和员工都在 django.contib.auth.models.UserManager 。然后是 creationuperuser 命令 django-admin



嗯,有管理员应用程序...有什么区别?

解决方案

我从Django获取文档:


Django最强大的部分之一是自动管理
界面。如果以超级用户身份登录,您可以访问创建,编辑和
删除任何对象(模型) )。



您可以使用员工标记创建员工用户。 工作人员标志控制
是否允许用户登录到管理界面(即
该用户是否被认为是
组织中的工作人员)。由于这个用户系统可以用于控制
访问公共(即非管理员)站点,因此这个标志区分了公共用户和管理员之间的



正常管理员用户 - 即活动的,非超级用户的工作人员 -
通过分配的权限被授予管理员访问权限。每个对象
可以通过管理界面进行编辑,具有三个权限:创建
权限,您创建的所有
模型的编辑权限和删除权限。



Django的管理网站使用权限系统,您可以使用该权限系统给
特定用户只访问
需要的界面部分。当您创建一个用户时,该用户没有权限,并且
由您自己授予用户特定权限



Django has superuser, staff, admin…

superuser and staff are in django.contib.auth.models.UserManager. Then there is the createsuperuser command of django-admin.

Well, there are admin apps… What's the difference?

解决方案

I take this from Django Documentation:

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

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

You can create staff user using staff flag. The "staff" flag controls whether the user is allowed to log in to the admin interface (i.e., whether that user is considered a "staff member" in your organization). Since this same user system can be used to control access to public (i.e., non-admin) sites, this flag differentiates between public users and administrators.

"Normal" admin users – that is, active, non-superuser staff members – are granted admin access through assigned permissions. Each object editable through the admin interface has three permissions: a create permission, an edit permission and a delete permission for all the models you had created.

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

这篇关于django的工作人员,管理员,超级用户有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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