MANAGE USERS AND
GROUPS IN DJANGO
ADMIN
CREATING SUPERUSERS
• A superuser is the admin user. Through the superuser, we can manage the entire website or
application. Running the following command creates a superuser:
• python manage.py createsuperuser
• Following this command, you will be prompted to enter a username and password for the
superuser. After confirming your password, the superuser will be created.
• Output
• Superuser created successfully!
MANAGING USERS
• Users represent the different types of people that interact with your site.
• These users might not have the same privileges as the admin, who has complete access to the
website.
• Through the admin/superuser, we can achieve the following:
• Add or delete users
• Edit users’ status
• Edit existing users
• Create user groups
• Add users to groups
• Add or remove user permissions
• Reset passwords
• We can also add users interactively using the admin index page. Simply click the green +
sign next to the Users entry, enter a username and password, and save.
USER PERMISSIONS AND STATUS
• When a user is created, they have no permissions. These permissions are granted by the
superuser and are user-specific.
MANAGING GROUPS
• Groups are a means of categorizing users. This allows for granting permissions to a specific
group. It also saves a lot of time, as compared to granting permissions to each individual
user.
• A user may belong to any number of groups and automatically has all the permissions
granted to that group.