Skip to content
Snippets Groups Projects

Thalia Website

New new Thalia website, now with extra Django.

#Concrexit

build status coverage report

Getting started

If you use Docker, please look at this part of the README.

  1. Get at least Python 3.4 and install the Pillow requirements as per below.
  2. Clone this repository
  3. Run source ./source_me.sh (or use your own favourite virtualenv solution)
  4. Run pip install -r requirements.txt
  5. Run pip install -r dev-requirements.txt
  6. cd website
  7. ./manage.py migrate to initialise the database
  8. ./manage.py createsuperuser to create the first user (note that this user won't be a member!)
  9. ./manage.py runserver to run a testing server

Testing and linting

  1. In the root folder of the project, run tox.

You may get errors about missing interpreters. That is normal and can be ignored. If you want to run a specific check, you can do the following:

tox -e flake8  # Runs the flake8 linter
tox -e py34    # runs the tests with python 3.4
tox -e py35    # runs the tests with python 3.5

Pillow dependencies

For Ubuntu 16.04, use:

apt-get install python3-dev gettext gcc build-essential libtiff5-dev libjpeg62-turbo-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev

Or try:

apt-get build-dep python3-pil

For other operating systems, see the Pillow Documentation.

Thabloid dependencies

To be able to generate JPGs from PDFs, we need ghostscript:

apt-get install ghostscript

Translating

Make sure to use British English.

To create translations for your app:

  1. cd into the application's directory
  2. ../manage.py makemessages --locale nl
  3. This creates or updates locale/nl/LC_MESSAGES/django.po
  4. Start poedit by calling poedit locale/nl/LC_MESSAGES/django.po
  5. ../manage.py compilemessages (should happen automatically when saving the file in poedit)
  6. Commit both the .po and .mo file to the repository

Docker

First run with Docker:

  1. docker-compose up -d
  2. docker-compose run web migrate
  3. docker-compose run web createsuperuser

Step 1. may take a while since docker-compose needs to retrieve all dependencies and build the Docker images. Step 2. creates the necessary tables and step 3. creates a superuser, as the command implies.

After step 3. you can access the Thalia website locally through http://localhost:8000/