Blame view

README.md 1.13 KB
a9d173ce   Goutte   Add a bare-bones ...
1
2
3

# Travel Carbon Footprint Calculator

a1f12452   Antoine Goutenoir   Add the new conte...
4
5
6
7
- https://travel-footprint-calculator.apps.goutenoir.com  (private demo)
- http://travel-footprint-calculator.irap.omp.eu  (official, for later)


69f8c67f   Antoine Goutenoir   Doc check while r...
8
9
10
11
12
13
14
15
## Overview

- Content is in `content.yml`.
- Configuration is in `content.yml`.
- HTML templates are in `flaskr/templates`.
- Estimation Models are in `flaskr/laws`.
- Controllers are in `flaskr/controllers`.

a9d173ce   Goutte   Add a bare-bones ...
16
17
18

## Installation

69f8c67f   Antoine Goutenoir   Doc check while r...
19
20
Tested only on Python `2.7`.  _Sprint._ 

b18c8b9f   Antoine Goutenoir   Document.
21
22
23
24
### Create a virtual environment

You don't _have to_.  But it's useful for development.

a9d173ce   Goutte   Add a bare-bones ...
25
    virtualenv venv
b18c8b9f   Antoine Goutenoir   Document.
26
27
28

Then, source it to enable it.

a9d173ce   Goutte   Add a bare-bones ...
29
    source venv/bin/activate
b18c8b9f   Antoine Goutenoir   Document.
30
31
32

### Install the python dependencies

a9d173ce   Goutte   Add a bare-bones ...
33
    pip install -r requirements.txt
b18c8b9f   Antoine Goutenoir   Document.
34
35
36

### Create an empty database

a9d173ce   Goutte   Add a bare-bones ...
37
    python manage.py createdb
b18c8b9f   Antoine Goutenoir   Document.
38
39
40

### Configure the secrets

b9fc86c3   Antoine Goutenoir   Secure the admin ...
41
42
    cp .env.dist .env
    nano .env
a9d173ce   Goutte   Add a bare-bones ...
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57


## Development

    source venv/bin/activate
    export FLASK_APP=flaskr
    export FLASK_ENV=development
    export FLASK_RUN_EXTRA_FILES="content.yml"
    flask run

Then, visit http://localhost:5000

> We're trying to remove the need for the `export` statements, but…


56c7b457   Antoine Goutenoir   Prepare support f...
58
59
60
## Build CSS and JS for prod

    flask assets build
b18c8b9f   Antoine Goutenoir   Document.