How to Set Your User as Staff or Superuser - DesignSafe-CI/portal GitHub Wiki
Some tasks require a developer to have a user with staff-level permissions.
Use Cases
- To be able to work in the CMS admin interface to change user-facing content.
Steps
-
Login to docker shell:
docker exec -it des_django /bin/bash
-
Enter python shell:
python manage.py shell
-
Find & Update your user:
from django.contrib.auth import get_user_model my_user = get_user_model().objects.get(username="my_username") # Set your local user to be "staff" or "superuser" my_user.is_staff = True my_user.is_superuser = True my_user.save()