Website and API for workload monitoring of students at TU Dresden.
This repository containes the code to run the workload monitoring website and the Web-API that is needed by the corresponding workload monitoring Android app. The Android app has its own repository (and documentation).
Most of the code is written in Python, using the Django web framework. The websites themselves are written in HTML and CSS and make use of the Django templating language. If you're new to Django, it is a good idea to try the very helpful tutorial. To store its data, Django uses a MySQL database. Authentication is set up to use the Shibboleth Single-Sign-On system, but it should be easy to switch to another authentication provider or use Djangos built in user management system.
A MySQL database is used to store the data which is entered by the students on the website and which is passed to the API. The database also contains information about the lectures which a student can take.
There are three main components that connect to the database: The user-facing website, the admin panel, and the API. This API is used by the workload Android app to retrieve and store data. This means that all data is collected in a single place. All three components are written in Python as a single Django app.
Please make sure you understand the difference between a Django project and a Django app. For reference, you can read this short tutorial: https://docs.djangoproject.com/en/1.9/intro/tutorial01/.
In this repository, the folder server-side/workload/workload
is the Django project. It contains the main configuration file settings.py
as well as the script which is caleld by the apache server, wsgi.py
. Two apps belong to the project: First, the main app which is located in the directory server-side/workload/workloadApp
. This app contains the views, the data models and the html for the workload website, the API and the admin panel. Additionally, the django-shibboleth-adapter
app is used for authentication. It is not part of this repository, the next step explains how to install it.
The website is using the Django web framework, version 1.9.7 Therefore a web server (apache2, nginx) with an installation of Django and all its dependencies is needed. Django is extremely well documented. For starters, here are:
Please consider that Django is under active developmnent and despite the developer's care for backwards compatibility, newer versions of Django might not always work. This project was tested with version 1.9.7, you might have to update the code to run with newer versions.
Other python dependencies are listed in the requirements.txt
To install the workload project, just clone the repository to your server. The Django project directory is server-side/workload
.
Create an empty file called workload.log
in the root directory of the repository and make sure that the server-user (usually www-data
) can write to it. Django will log into this file.
If you are using Shibboleth, you will have to set it up for you apache server and make sure all necessary attributes are passed. Your shhibboleth identity provider should be able to assist you with that or point you to the right documentation. You will also have to install the django-shibboleth-adapter
Django app and configure it to use the right attributes.
survey.zqa.tu-dresden.de
survey.zqa.tu-dresden.de
./home/kon
./home/kon/workload/workload.log
workon workload
in the shell.database-backup
. The file name of the backup which is stored contains the month and day of month. Therefore, once a year, the backup is overwritten. This rotation mechanism should prevent the server from running out of dsik if left unattended for a long time./etc/apache2/sites-enabled/
. Server logs are in /var/log/apache2
.mod_shib
module is activated and the shibboleth configuration can be found in /etc/shibboleth
.django-shibboleth-adapter
is cloned into /home/kon
and its app directory is symlinked from the Django project directory, /home/kon/workload/server-side/workload
See the LICENSE file for license rights and limitations (GNU AGPL).