README.md 1.51 KB
Newer Older
luxcem's avatar
Readme  
luxcem committed
1
2
3
4
5
6
7
8
9
10
11
12
13
# 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

cynddl's avatar
cynddl committed
14
15
16
17
18
19
20
21
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

luxcem's avatar
Readme  
luxcem committed
22
23
24
## Settings

Create a file in `project/settings/env.py` which contains django
25
settings for **DEBUG**, **SECRET_KEY** and **SITE_ID**.
luxcem's avatar
Readme  
luxcem committed
26

27
28
For testing you can use `DEBUG = True`, a random string for
`SECRET_KEY` and `SITE_ID=1`.
luxcem's avatar
Readme  
luxcem committed
29
30
31
32
33
34

In production you can use env variables with

```python
os.environ["DJANGO_DEBUG"]
os.environ["DJANGO_SECRET_KEY"]
35
os.environ["DJANGO_SITE_ID"]
luxcem's avatar
Readme  
luxcem committed
36
37
```

38
39
40
41
42
43
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.

44
45
46
47
48
Groups have to be initialized with the following command:
```sh
    $ python manage.py init_groups
```

luxcem's avatar
Readme  
luxcem committed
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
## Database

You can run migrations with :

    $ python manage.py migrate

## Dev server

To launch the dev server :

    $ python manage.py runserver

## Tests

To launch tests install requirements-tests.txt

    $ pip install -r requirements-tests.txt
    $ pytest

Coverage with

    $ pytest --cov=.