diff --git a/docs/tech/installation/users.md b/docs/tech/installation/users.md index dd511ee1e1e7475e41eaffc0a4f73e6ed7df24c3..aeaee7a7f96a95ae4449a4ff808553cc169f057f 100644 --- a/docs/tech/installation/users.md +++ b/docs/tech/installation/users.md @@ -1,34 +1,48 @@ ## Initial user creation -INJECT Exercise Platform without prior setup does not generate any standard admin user, that you may use to login and manage the platform. +INJECT Exercise Platform without prior setup does not generate any standard admin user, +that you may use to log in and manage the platform. -There are currently two ways how you may generate said Admin user. +There are currently two ways how you may generate said Admin user, +both of which require direct access to the backend docker container. -### Direct creation via Docker +To enter the container, run the following command: +``` +docker compose exec -it backend /bin/sh +``` -After launching the deployment, please wait for all migrations to finish and execute following command. Navigate your shell to the folder of your Docker compose configuration directly and +### Management command -- Execute a shell session in the backend container, please make sure to navigate your shell to the folder where your Docker compose resides at +**This option REQUIRES SMTP to be set up.** - ``` - docker compose exec backend python manage.py shell - ``` +In the docker container, run: +``` +python manage.py initadmins <comma-separated list of emails> +``` -- Create a admin using the Django shell. Replace `email@test.com` and `long_and_secure_password` with your desired admin credentials.: +This command will create an admin account for each email address in the list +and send the login credentials to that address. - ``` python - from user.models import User - User.objects.create_superuser(username="email@test.com", password="long_and_secure_password") - ``` +Example: +``` +python manage.py initadmins jane.doe@mail.com,john.doe@mail.com +``` -- These steps may be further simplified/automized by merging both of these commands accordingly +### Django shell - ``` - docker compose exec backend python manage.py shell -c "from user.models import User; User.objects.create_superuser(username="email@test.com", password="long_and_secure_password");" - ``` +This is the only option to create admin users without SMTP. -After creation of the user, you may login into the IXP. +In the docker container, run these commands: +``` +python manage.py shell +from user.models import User +User.objects.create_superuser(username="email@test.com", password="long_and_secure_password") +``` + +Replace `email@test.com` and `long_and_secure_password` with your desired admin credentials. + +After creation of the user, you may log in into the IXP. If you need to create normal users, then please refer to the [User Onboarding](./../security.md#user-onboarding).