Skip to content
No description, website, or topics provided.
Branch: develop
Clone or download
Pull request Compare This branch is even with opendata-stuttgart:develop.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
assets
babel
initdb
migrations
static
systemd
translations
webapp
.dockerignore
.flaskenv.dist
.gitignore
Dockerfile
Pipfile
Pipfile.lock
README.md
docker-compose.yml
gulpfile.js
gunicorn.conf
package.json
requirements-prod.txt
requirements.txt
start-server.sh
wsgi.py

README.md

meine luftdaten

luftdaten.info self-service registration portal.

Configuration file

Default configuration settings (set from webapp/default_settings.py) are suitable for running in non-production Docker environment. If you need to override any configuration variables, you can create webapp/config.py file based off webapp/config.py.dist.

Additionally, when running outside of docker, .flaskenv file is required. Basic development environment file can be copied from .flaskenv.dist.

virtualenv setup

virtualenv -p python3 venv
source venv/bin/activate
pip install -r requirements.txt

Database intialization

flask db upgrade

# Create initial user and roles
flask users create testing@luftdaten.info --password password -a
flask roles create admin
flask roles add testing@luftdaten.info admin

Running

flask run

Docker development

To ease up development Docker container and relevant docker-compose.yml project file has been created. Following will start up basic development environment including MySQL database with "external" schema and redis. Code reloads are active by default.

docker-compose up

Web application is available on http://localhost:5000/

To create new database migration:

docker-compose run --rm web flask db migrate -m 'Short change summary'

Flask environment can be overriden by modifying docker-compose.yml only.

Gulp automatic rebuilds

To start automatic CSS/JS rebuilds on change use this:

docker-compose run --rm gulp npm start

Create new langauge

extract text and lazy_gettext() functions

venv/bin/pybabel extract -F ./babel/babel.cfg -k lazy_gettext -o ./babel/messages.pot .

update langauge

venv/bin/pybabel extract -F ./babel/babel.cfg -k _l -o ./babel/messages.pot .
venv/bin/pybabel update -i ./babel/messages.pot -d ./translations

create translated language

venv/bin/pybabel init -i ./babel/messages.pot -d ./translations -l country_code
venv/bin/pybabel init -i ./babel/flask_security.pot -D flask_security -d ./translations -l country_code

compile into binary

venv/bin/pybabel compile -d ./translations/
venv/bin/pybabel compile -d ./translations/ -D flask_security
You can’t perform that action at this time.