Blame view

README.md 1.06 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

f48f4a8f   Antoine Goutenoir   Optimize a bottle...
44
45
46
47
48
49
50
51
52
53
54
### Configure permissions

`var/runs` must be writeable by the application.


## Build CSS and JS ()for prod)

    flask assets build



a9d173ce   Goutte   Add a bare-bones ...
55
56
57
58

## Development

    source venv/bin/activate
4a6ab110   Antoine Goutenoir   Sweep dust under ...
59
    source .env.flaskrun
a9d173ce   Goutte   Add a bare-bones ...
60
61
62
    flask run

Then, visit http://localhost:5000
a9d173ce   Goutte   Add a bare-bones ...