This repository contains the source of the website of GCC!: https://gcc.prologin.org.
GCC! is a free computer science summer camp for girls under 18 organised by the association Prologin since 2014.
Running the GCC! website requires the following dependencies:
- Git
- Python 3
- NPM (for Javascript & CSS assets)
- PostgreSQL
- A running version of the Prologin website in order to interact with its OAuth server.
Theses requirements are a subset of the requirements of the Prologin website itself, you may refer to the README of the corresponding repository for details about there setup.
Clone the website and, optionally, the other Prologin repositories needed for the different modules of the website:
git clone git@github.com:prologin/gccsite
git clone git@github.com:prologin/archives # Edition archives (private)Then, enter the website directory:
cd gccsite
Use a virtual environment to install the Python dependencies of the website:
python3 -m venv .venv
source .venv/bin/activate
pip install -U pip
pip install -r requirements.txtDownload the web dependencies from NPM:
( cd assets && npm install )Copy the sample configuration to a file of your choice. I recommend to use
dev.py for a development environment:
cp gccsite/gccsite/settings/{conf.sample,dev}.pyThe default settings should work by default if you are following this guide,
but if needed, you can edit gccsite/gccsite/settings/dev.py to adjust some
settings.
Create the gcc PostgreSQL database, and run the migrations :
createdb gcc
./gccsite/manage.py migrateIf you followed this guide, the connection through the website of Prologin should work by default, you can however modify this configuration if you please:
dev.py on the Prologin website:
AUTH_TOKEN_CLIENTS = {
'gcc': AuthTokenClient('SECRET', '//localhost:8001/user/auth/callback'),
}dev.py on the GCC! website:
OAUTH_ENDPOINT = 'http://localhost:8000/user/auth'
OAUTH_SECRET = 'SECRET'(Note: If you would rather work with an anonymized database dump of the website, ask one of the Prologin roots to provide you one.)
python manage.py edition createEvery time you need to work on the website:
- Enter the virtualenv:
source .venv/bin/activate - Launch the local dev server:
make runserver
In order to contribute, please follow this guide
- Create a branch for the issue/functionnality you wish to implement
- Commit all your changes in the new branch and then create a Merge Request
- Format the code as follows
All of the python codebase needs to be formatted using black
by running black . at the root of the project before any commit.
You can automate the process by installing the recommended pre-commit hooks:
pip install -r requirements-dev.txt
pre-commit installThe website user-facing strings are internationalized through Django's internal i18n framework.
You can translate the strings locally by editing the .po files in your editor
or using a dedicated software such as poedit.
To ease the community translation process, it is possible to upload the
untranslated (English) strings to Transifex, ask people to translate them (eg.
using the Transifex web app) and download them back to the repository.
To that end, use the provided make commands:
# I've created/update source (English) strings, let's push them
# (we pull before to update local strings just in case)
make tx-pull tx-push
# ... translate on Transifex ...
# Get back the translated strings
make tx-pull
# Commit
git commit gccsite/locale -m 'locale: update for <feature>'