Creating a Staff Account¶
This page documents how to create a staff account via the Django CLI when no existing user has staff privileges.
Prerequisites¶
- SSH access to the server running VOR Stream Django service
- Ability to switch to the VOR installation user
Note
The examples below use the default installation user vrisk and default
installation path /opt/vor. Update these values accordingly if your
installation differs.
Creating a Staff Account¶
To create a new superuser account with staff privileges, SSH into the Django server and switch to the installation user:
su - vrisk
Set the required environment variable and run the createsuperuser command:
export VOR_DJANGO_CONFIG=/opt/vor/etc/django/config.json
cd /opt/vor/django
venv/bin/python src/manage.py createsuperuser
PostgreSQL Environments
If your installation uses PostgreSQL, you must also set the library path before running Django management commands on this page:
export LD_LIBRARY_PATH=/opt/vor/pgsql/lib
You will be prompted to enter:
- Username
- Email address
- Password
The created user will have both staff and superuser status, granting full
access to the Administration UI.
To create a user non-interactively, use the --noinput flag:
venv/bin/python src/manage.py createsuperuser \
--username <username> \
--email <email> \
--noinput
Note that users created with --noinput will not be able to log in until they
are given a valid password.
Granting Staff Status to an Existing User¶
If a user already exists but needs staff privileges, you can update their status using Django's shell.
Switch to the installation user and open the Django shell:
su - vrisk
export VOR_DJANGO_CONFIG=/opt/vor/etc/django/config.json
cd /opt/vor/django
venv/bin/python src/manage.py shell
Then in the Django shell:
from django.contrib.auth import get_user_model
User = get_user_model()
user = User.objects.get(username='<username>')
user.is_staff = True
user.save()
Replace <username> with the actual username of the user you want to grant
staff access.
Verifying Staff Status¶
To verify a user has staff status, you can check in the Django shell:
from django.contrib.auth import get_user_model
User = get_user_model()
user = User.objects.get(username='<username>')
print(f"Staff: {user.is_staff}, Superuser: {user.is_superuser}")