Thalia Website
New new Thalia website, now with extra Django.
#Concrexit
Getting started
If you use Docker, please look at this part of the README.
- Get at least Python 3.4 and install the Pillow requirements as per below.
- Clone this repository
- Run
source ./source_me.sh
(or use your own favourite virtualenv solution) - Run
pip install -r requirements.txt
- Run
pip install -r dev-requirements.txt
cd website
-
./manage.py migrate
to initialise the database -
./manage.py createsuperuser
to create the first user (note that this user won't be a member!) -
./manage.py runserver
to run a testing server
Testing and linting
- 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:
-
cd
into the application's directory ../manage.py makemessages --locale nl
- This creates or updates
locale/nl/LC_MESSAGES/django.po
- Start poedit by calling
poedit locale/nl/LC_MESSAGES/django.po
-
../manage.py compilemessages
(should happen automatically when saving the file in poedit) - Commit both the
.po
and.mo
file to the repository
Docker
First run with Docker:
docker-compose up -d
docker-compose run web migrate
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/