README.md 2.4 KB
Newer Older
Thom Wiggers's avatar
Thom Wiggers committed
1 2 3 4 5 6
Thalia Website
==============

New new Thalia website, now with extra Django.

    #Concrexit
Thom Wiggers's avatar
Thom Wiggers committed
7 8 9 10

Getting started
---------------

11
If you use Docker, please look at [this part](#docker) of the README.
12

Luuk Scholten's avatar
Luuk Scholten committed
13
0. Get at least Python 3.4 and install the Pillow requirements as per below.
Thom Wiggers's avatar
Thom Wiggers committed
14 15 16 17 18 19
1. Clone this repository
2. Run `source ./source_me.sh` (or use your own favourite virtualenv solution)
3. Run `pip install -r requirements.txt`
4. Run `pip install -r dev-requirements.txt`
5. `cd website`
6. `./manage.py migrate` to initialise the database
Thom Wiggers's avatar
Thom Wiggers committed
20 21
7. `./manage.py createsuperuser` to create the first user (note that this user won't be a member!)
8. `./manage.py runserver` to run a testing server
Thom Wiggers's avatar
Thom Wiggers committed
22 23 24 25 26

Testing and linting
-------------------

1. In the root folder of the project, run `tox`.
27 28 29 30 31 32 33

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
Thom Wiggers's avatar
Thom Wiggers committed
34 35 36 37 38 39

Pillow dependencies
-------------------

For Ubuntu 16.04, use:

40
    apt-get install python3-dev gettext gcc build-essential libtiff5-dev libjpeg62-turbo-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev
Thom Wiggers's avatar
Thom Wiggers committed
41

Thom Wiggers's avatar
Thom Wiggers committed
42 43 44 45
Or try:

    apt-get build-dep python3-pil

Luuk Scholten's avatar
Luuk Scholten committed
46
For other operating systems, see the [Pillow Documentation][pillow-install].
Thom Wiggers's avatar
Thom Wiggers committed
47 48 49


[pillow-install]: https://pillow.readthedocs.io/en/latest/installation.html
Luuk Scholten's avatar
Luuk Scholten committed
50

Joost Rijneveld's avatar
Joost Rijneveld committed
51 52 53 54 55 56 57
Thabloid dependencies
---------------------

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

    apt-get install ghostscript

58 59 60 61 62 63 64 65
Translating
------------------

Make sure to use British English.

To create translations for your app:

1. `./manage.py makemessages <appname>`
66 67
2. This will create or update the files under `<appname>/locale/`.
3. Use poedit (or your favourite tool -- please do not use a plain text editor since those cannot handle all the subtleties) to fix the translations.
68
4. `./manage.py compilemessages`
69 70 71 72 73 74 75 76 77 78 79 80 81 82

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.

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