From a22157dbfb75ecf2107f81181dd86700ccd180d4 Mon Sep 17 00:00:00 2001 From: xdvora19 <xdvora19@fi.muni.cz> Date: Wed, 12 Jun 2024 04:36:59 +0200 Subject: [PATCH] add guide for manual user onboarding --- docs/tech/security.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/docs/tech/security.md b/docs/tech/security.md index 9174189..aa2b9b6 100644 --- a/docs/tech/security.md +++ b/docs/tech/security.md @@ -40,6 +40,8 @@ but it is not necessary because ADMIN has control over every resource on the pla ## User onboarding +### Authomatically + Users can be added to the platform via a `.csv` file in the following format: ``` @@ -74,3 +76,23 @@ Admin can be created only by admin users. As a separator for the column, you can use either `,` or `;`. An example of such a file can be [downloaded](https://gitlab.fi.muni.cz/inject/inject-docs/-/raw/main/docs/tech/example_csv.csv?ref_type=heads&inline=false). + +### Manually + +Another way of adding users is manually via the console: + + - List the running Docker containers to find the **NAME** of the backend container: + ``` + docker ps + ``` + - Execute a shell session in the backend container. Replace `CONTAINERNAME` with the actual container **NAME** of the backend service: + ``` + docker exec -it CONTAINERNAME python manage.py shell + ``` + +- Create a user using the Django shell. Replace `email@test.com` and `password` with your desired user credentials.: + + ``` python + from user.models import User + User.objects.create_user(username="email@test.com", password="password") + ``` \ No newline at end of file -- GitLab