# LQDN RP This project uses Django 1.11 and python >= 3.5 ## Requirements To run the project, start a virtual environment and install requirements.txt requirements-dev.txt contains additional dependencies for development $ pip install -r requirements.txt $ pip install -r requirements-dev.txt To compile the CSS stylesheets and JS scripts, install npm, then run the following commands to run yarn (to fetch and install dependencies) and webpack (to compile local assets) $ npm install -g yarn webpack $ yarn install $ webpack ## Settings Create a file in `project/settings/env.py` which contains django settings for **DEBUG**, **SECRET_KEY** and **SITE_ID**. For testing you can use `DEBUG = True`, a random string for `SECRET_KEY` and `SITE_ID=1`. In production you can use env variables with ```python os.environ["DJANGO_DEBUG"] os.environ["DJANGO_SECRET_KEY"] os.environ["DJANGO_SITE_ID"] ``` You'll also need to define a DJANGO_ALLOWED_HOSTS containing the FQDN of the RP before being able to run in production If DEBUG is defined as True, ALLOWED_HOSTS is set to allow connections from any hosts. Groups have to be initialized with the following command: ```sh $ python manage.py init_groups ``` ## Database You can run migrations with : ```sh $ python manage.py migrate ``` You can seed the database with a provided fixtures located in apps/rp/fixtures/all_articles.json: ```sh $ python manage.py loaddata all_articles.json ``` ## Dev server To launch the dev server : ```sh $ python manage.py runserver ``` ## Tests To launch tests install requirements-tests.txt ```sh $ pip install -r requirements-tests.txt $ pytest ``` Coverage with ```sh $ pytest --cov=. ```