What's the difference between staff, admin, superuser in django?

后端 未结 3 2054
萌比男神i
萌比男神i 2020-12-14 14:09

Django has superuser, staff, admin…

superuser and staff are in django.contib.auth.models.UserManager. Then there is the createsuperuser co

3条回答
  •  北海茫月
    2020-12-14 14:37

    A superuser automatically has all permissions (has_perm will return True).

    A staff member can login to the admin pages.

    The admin pages are a simple interface to the models that you've configured to show up in it. It only shows the models that the current user has the right permissions for.

    So if someone is both superuser and staff, they can login to the admin site and have full access to all the models that show up in the admin site.

提交回复
热议问题