Welcome to the repository of Tartarus Order System for Take-away Items, TOSTI for short. This application is designed to provide Tartarus with an online tool for ordering take-away items. There are also a lot of other integrated features:
This project is built using the Django framework. Poetry is used for dependency management.
poetry
uses your your correct base python version: poetry env use python
. poetry install
to install all dependencies (into a virtual environment dedicated to this project).poetry shell
to start a shell that uses your virtual environment (or prefix all commands with poetry run
).cd website
to change directories to the website
folder containing the project../manage.py migrate
to initialise the database and run all migrations. ./manage.py createsuperuser
to create an administrator that is able to access the backend interface later on. ./manage.py runserver
to start the development server locally.Now your server is setup and running on localhost:8000
.
Notice that SAML login will not be used by default on development systems.
TOSTI is deployed using Docker and Docker Compose. The docker-compose.yml
file is used to define the services that are used in the deployment. The Dockerfile
is used to define the image that is used for the Django application.
Specifically, TOSTI is running in the PGO environment of CNCZ (the IT department of the Radboud University Faculty of Science).
This automatically deploys the docker-compose.yml
file.
To interact with the environment, you should use the pgoctl
client.
This client connects with the PGO API to manage the environment via SSH.
Therefore, your SSH public key must be in the ssh
directory of this project.
Run (for example) pgoctl -i ~/.ssh/id_ed25519 -- dockervm02.science.ru.nl:tosti//up
to deploy the application, and pgoctl -i ~/.ssh/id_ed25519 -- dockervm02.science.ru.nl:tosti//down
to stop the application.
Or run pgoctl -i ~/.ssh/id_ed25519 -- dockervm02.science.ru.nl:tosti//logs
to see the logs.
Or run pgoctl -i ~/.ssh/id_ed25519 -- dockervm02.science.ru.nl:tosti//exec web python manage.py sendtestemail
to send a test email.
Notice that pgoctl
does not (yet) support interactive commands, so you cannot run manage.py shell
for example.
Also any non-successful commands (with a non-zero exit code) will not be shown and will not show their output.
Finally, you must be connected with the CNCZ VPN to use pgoctl
.
Important notices:
/admin-login
, it is possible to bypass SAML login (for example for first installation when SAML has not yet been set up).