Teaching Time Tool

Tool for managing staff teaching time.

Build Status codecov License PyPI

Installation

Clone the repo to the server:

cd /var/www/
git clone https://github.com/Southampton-RSG/physics-workload

Also copy the cut-down spreadsheets derived from the workload 2425.xlsx spreadsheet into the same directory as the code. They aren’t included in the repo as they contain personally identifiable data.

File Server

If using this on a machine serving multiple sites, you’ll need to add the configuration file to your existing Nginx setup. Assign ownership of the directory to the physics-workload-staff group and add nginx to it:

$ sudo usermod -a -G physics-workload-staff nginx
$ sudo chgrp -R voidorchestra-staff /var/www/physics-workload
$ sudo chmod -R g+rw /var/www/physics-workload 

Then, depending on your Linux distribution:

Debian/Ubuntu

Copy or link nginx/physics-workload.conf to your /etc/nginx/sites-enabled/ directory, then restart Nginx:

$ ln -s /var/www/physics-workload/nginx/physics-workload.conf /etc/nginx/sites-enabled/ 
$ sudo systemctl reload nginx
$ sudo systemctl restart nginx

Fedora/RHEL

Copy nginx/physics-workload.conf file to your /etc/nginx/conf.d directory. Then, flag the log directory as a log directory under SELinux, and the output directory as as HTML content directory too:

$ sudo cp /var/www/voidorchestra/nginx/physics-workload.conf /etc/nginx/conf.d/ 
$ sudo semanage fcontext -a -t httpd_sys_content_t "/var/www/physics-workload/staticfiles(/.*)?"
$ sudo restorecon -R -v /var/www/physics-workload/staticfiles
$ sudo semanage fcontext -a -t httpd_log_t "/var/www/physics-workload/logs(/.*)?"
$ sudo restorecon -R -v /var/www/physics-workload/logs/

Running

The tool is run using docker compose. Generally, it’s best to do this in a screen session. Start the server (and associated containers) using:

screen
sudo docker compose up web

Initialising

If this is the first time the tool is being run, import the .csv data:

sudo docker exec -it physics-workload-django /bin/bash 
make clean
make data
make superuser

Then, log into the website to link your user account to the site. The command make superuser will then make the swm1r18 account site staff; edit the script make_swm1r18_superuser.py to change the account.

Updating

To update the tool, take the containers down, rebuild, and restart using:

screen -r
sudo docker compose down 
sudo docker compose build --no-cache
sudo docker compose up web

Extra

Note

This library was generated using copier from the Base Python Project Template repository.