AURA Steering: Program Scheduler
AURA Steering is the scheduling module, where the actual program schedule of the whole station is stored as well as all infos regarding single shows and emissions.
It also acts as an OpenID Connect provider for dashboard and tank.
Requirements
- Docker Engine 20.10+
- Docker Compose 2.2+
Quickstart
First build the services:
$ docker compose build
Then, you can setup the database:
$ docker compose run django ./manage.py migrate
You can the load all the fixtures. This loads data for the authentication (users, groups and permissions) and for the program app (categories, funding categories, hosts, languages, music focus, recurrence rules, shows, topics and types).
This provides enough data to get started:
$ docker compose run django ./manage.py loaddata fixtures/*/*.json
Alternatively, if you prefer, you can just create a super user after setting up the database:
$ docker compose run django python manage.py createsuperuser
The only required fixtures are the recurrence rules, these are needed to create schedules:
$ docker compose run django ./manage.py loaddata fixtures/program/rrule.json
Then, you can create a RSA Key and the clients for dashboard and tank:
$ docker compose run django ./manage.py creatersakey
$ docker compose run django ./manage.py create_oidc_client dashboard public -r "id_token token" -u http://localhost:8080/oidc_callback.html -u http://localhost:8080/oidc_callback_silentRenew.html -p http://localhost:8080/
$ docker compose run django ./manage.py create_oidc_client tank confidential -r "code" -u http://localhost:8040/auth/oidc/callback
If you prefer to use the admin interface for this, refer to the [OpenID Client Configuration](https://gitlab.servus.at/aura/meta/-/blob/master/docs/administration/oidc-client-config.md#registering-oidc-clients-via-the-admin-interface).
Finally, you can start the services:
$ docker compose up
You can then login into the admin interface at http://localhost:8000/admin or use the API at http://localhost:8000/api/v1/
Testing
If you want to run the test suite, you can run pytest in the container:
$ docker compose run django pytest
venv
Warning
This is not the recommended way: it uses SQLite instead of Postgres and you may run into other issues.
If you really don't want to use Docker, you can install steering using a virtual environment.
Create and activate a virtual environment:
$ python3.9 -m venv venv
$ source venv/bin/activate
Install the required dependencies:
(venv) $ pip install --upgrade pip
(venv) $ pip install -r requirements.txt
Then, you can setup the database:
(venv) $ ./manage.py migrate
And load the fixtures:
(venv) $ ./manage.py loaddata fixtures/*/*.json
Or, if you prefer, you can just create a super user after setting up the database:
(venv) $ manage.py createsuperuser
The only required fixtures are the recurrence rules, these are needed to create schedules:
$ docker compose run django ./manage.py loaddata fixtures/program/rrule.json
Then, you can create a RSA Key and the clients for dashboard and tank:
(venv) $ ./manage.py creatersakey
(venv) $ ./manage.py create_oidc_client dashboard public -r "id_token token" -u http://localhost:8080/oidc_callback.html -u http://localhost:8080/oidc_callback_silentRenew.html -p http://localhost:8080/
(venv) $ ./manage.py create_oidc_client tank confidential -r "code" -u http://localhost:8040/auth/oidc/callback
Finally, you can start the development server:
(venv) $ ./manage.py runserver