/website

Website of Tanzquotient

Primary LanguagePythonGNU General Public License v2.0GPL-2.0

Tanzquotient (TQ) Website

The website is built using Django, and uses redis for caching and celery as a task queue.

Users can find a user documentation here.

The main repository lives on the ETH Gitlab and is mirrored to Github.

The repository contains the needed configurations to deploy to SIP.

Local Setup

  1. Make sure Docker and Docker Compose are installed.
  2. Clone this repo: git clone <repo-url>
  3. Install dev requirements: pip install -r requirements-dev.txt
  4. Initialize the project: ./scripts/initialize_project.sh
  5. Run the project: docker-compose up
  6. Find the website at localhost:8000

Using Intellij or PyCharm

Useful resources:

Configuration

All configuration lives in an environment file: .env. The following elaborate scheme of scripts is used to generate it.

The file variables.yml is the single source of truth by defining all environment variables needed for this project to run. The file is checked into the git repository. Do not modify variables.yml unless you want to define new env variables or remove outdated ones.

The file overrides.yml contains custom values for your setup. A basic version will be generated when initializing the project. This file is ignored by git. Do not add it to the repository. The file is machine specific and could potentially contain secrets.

Both need to be of the following form:

# General form for an entry
<NAME_OF_VARIABLE>: <value>

# Example
COMPOSE_FILE: docker-compose.yml
TQ_DEBUG: true

Generate Environment

Run ./scripts/generate_env.py [--sip] [--overrides FILE] to generate the environment.

  • Without arguments it will create a .env file for Docker Compose and Django to use.
  • --sip will read the variables provided by SIP and create a .env file
  • To use a different overrides file specify --overrides

Documentation

There is a not-quite-up-to-date documentation at ReadTheDocs.