Name Last Update
bin Loading commit data...
flaskr Loading commit data...
tests Loading commit data...
var Loading commit data...
.env.dist Loading commit data...
.env.flaskrun Loading commit data...
.gitignore Loading commit data...
Dockerfile Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
VERSION Loading commit data...
content.yml Loading commit data...
docker-compose.yml Loading commit data...
main.py Loading commit data...
main.wsgi Loading commit data...
manage.py Loading commit data...
requirements.txt Loading commit data...
uwsgi.ini Loading commit data...

README.md

Travel Carbon Footprint Calculator

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.

Installation

Works on Python 2.7 up to 1.2 version. Works on Python 3.7 from 1.3 version.

Create a virtual environment

You don't have to. But it's useful for development.

virtualenv .venv

Then, source it to enable it.

source .venv/bin/activate

Install the python dependencies

You will need Cython.

sudo apt install cython
pip install -r requirements.txt

Create an empty database

python manage.py createdb

Configure the secrets

cp .env.dist .env
nano .env

Configure permissions

var/runs must be writeable by the application. It is the file-based part of the database.

Build CSS and JS (for prod)

flask assets build

Development

source .venv/bin/activate
source .env.flaskrun
flask run

Then, visit http://localhost:5000