20.3.2 Groups in the Shell

Groups are an easy way to organize permissions. Typically, it’s best not to assign permissions to users directly. Instead, you create groups (such as administrator, manager, etc.) that have different levels of permissions. Users who belong to these groups inherit the permissions of the group.

Developers often confuse the is_staff and is_superuser fields on the User model with Group instances. By default, there are no groups defined, as shown in Example 20.20.

Example 20.20: Python Interpreter Code

>>> from django.contrib.auth.models import Group >>> Group.objects.all() []

Our site is going to need capable users whom we trust to update the website with valid information. We can create ...

Get Django Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.