2022-01-30 21:42:04 +00:00
|
|
|
# Managing Users
|
|
|
|
|
|
|
|
## Creating a User
|
|
|
|
|
|
|
|
<video style="max-width: 320px;" autoplay controls loop muted playsinline>
|
|
|
|
<source src="../../assets/videos/user_add.mp4" type="video/mp4">
|
|
|
|
</video>
|
|
|
|
|
|
|
|
## Changing User Settings
|
|
|
|
|
|
|
|
<video style="max-width: 320px;" autoplay controls loop muted playsinline>
|
|
|
|
<source src="../../assets/videos/user_settings.mp4" type="video/mp4">
|
|
|
|
</video>
|
|
|
|
|
|
|
|
## Changing User Password
|
|
|
|
|
|
|
|
<video style="max-width: 320px;" autoplay controls loop muted playsinline>
|
|
|
|
<source src="../../assets/videos/user_password.mp4" type="video/mp4">
|
|
|
|
</video>
|
2022-10-04 15:24:01 +00:00
|
|
|
|
|
|
|
## Creating a User from the Command Line
|
|
|
|
|
2022-10-22 06:15:49 +00:00
|
|
|
A user's type can be:
|
|
|
|
|
|
|
|
- Read only (can access all data but not make new entries)
|
|
|
|
- Standard (default, can access and make/edit any type of entry)
|
|
|
|
- Staff (bypasses permissions, can access Database Admin area)
|
|
|
|
|
2022-10-04 15:24:01 +00:00
|
|
|
There are 2 ways you can create a user from the command line:
|
|
|
|
|
|
|
|
1. Passing user's password as an argument:
|
|
|
|
|
|
|
|
```shell
|
|
|
|
python manage.py createuser --username <username> --password <password>
|
|
|
|
```
|
|
|
|
|
2022-10-22 06:15:49 +00:00
|
|
|
This will create a user with the standard privileges.
|
|
|
|
|
2022-10-04 15:24:01 +00:00
|
|
|
2. Interactively setting user's password:
|
|
|
|
|
|
|
|
```shell
|
|
|
|
python manage.py createuser --username <username>
|
|
|
|
```
|
|
|
|
|
|
|
|
You will then be prompted to enter and confirm a password.
|
|
|
|
|
2022-10-31 05:24:20 +00:00
|
|
|
- If you want to create a user with read only privileges, pass in the `--read_only` flag:
|
2022-10-22 06:15:49 +00:00
|
|
|
|
|
|
|
```shell
|
2022-10-31 05:24:20 +00:00
|
|
|
python manage.py createuser --username <username> --password <password> --read-only
|
2022-10-22 06:15:49 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
- If you want to create a user with the highest level of permission, you can append the `--is-staff` argument:
|
2022-10-04 15:24:01 +00:00
|
|
|
|
|
|
|
```shell
|
|
|
|
python manage.py createuser --username <username> --is-staff
|
|
|
|
```
|
|
|
|
|
|
|
|
- Another argument you can use with this command is `--email`
|
|
|
|
|
|
|
|
```shell
|
|
|
|
python manage.py createuser --username <username> --email <email>
|
|
|
|
```
|
|
|
|
|
|
|
|
- To get a list of supported commands:
|
|
|
|
|
|
|
|
```shell
|
|
|
|
python manage.py createuser --help
|
|
|
|
```
|