README.md 1.24 KB
Newer Older
Julien Palard's avatar
Julien Palard committed
1
2
# How to contribute

Antoine Angot's avatar
Antoine Angot committed
3
4
5

## Requirements

6
This project requires Python 3.6 at least.
Antoine Angot's avatar
Antoine Angot committed
7

8
9

## Install
Antoine Angot's avatar
Antoine Angot committed
10

Julien Palard's avatar
Julien Palard committed
11
12
13
```
pip install -r requirements.txt
./manage.py migrate
Julien Palard's avatar
Julien Palard committed
14
15
./manage.py loaddata initial  # To get some users and exercises
# (Initial data can be updated using: ./manage.py dumpdata > website/fixtures/initial.json)
Julien Palard's avatar
Julien Palard committed
16
./manage.py createsuperuser
Jérôme's avatar
Jérôme committed
17
./manage.py runserver
Julien Palard's avatar
Julien Palard committed
18
19
```

Jérôme's avatar
Jérôme committed
20
21
Install and run a redis server.

Julien Palard's avatar
Julien Palard committed
22
23
24
25
You'll maybe need a moulinette running too, currently in the
for_django branch of the moulinette, install firejail, and start it using:

    ./server.py http://127.0.0.1:8000/api/ --verbose --auth staff_login:staff_password
Julien Palard's avatar
Julien Palard committed
26
27


Julien Palard's avatar
Julien Palard committed
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
## Translations

```
$ django-admin makemessages -a
# Edit the .po files
$ django-admin compilemessages
```

To translate exercises you'll need to fetch them via the API first:

```
$ pip install requests
$ mkdir -p locale/fr/LC_MESSAGES/
$ python scripts/fetch.py --endpoint https://www.hackinscience.org/api/exercises/
$ python scripts/pygettext.py -o locale/fr/LC_MESSAGES/django.pot to_translate.py
$ cd locale/fr/LC_MESSAGES
$ if [ -f django.po ] ; then msgmerge -U django.po django.pot; else cp django.pot django.po; fi
# msgfmt django.po -o django.mo
```


Julien Palard's avatar
Julien Palard committed
49
50
51
# TODO

- In the exercise page, links to documentation should open in a new tab.