luftaten-datahub is an open source plattform build on the Django Web Framework. It is an citizen science tool to explore air quality data measured by Luftdaten.at devices and other sources.
Development version:
docker compose up -d
docker compose exec web python manage.py migrate
docker compose exec web python manage.py createsuperuser
open in web browser: http://localhost
Create migrations after doing changes at the data models:
docker compose exec web python manage.py makemigrations
Changes to the database:
docker compose exec web python manage.py shell
>> from {app_name}.models import {model_name}
>> {model_name}.objects.all().delete()
Run the unit tests. docker compose exec web python manage.py test docker compose logs
There are https-tests in the /test folder which can be run with the Visual Studio Code Extension REST Client.
All template files are in the folder /code/templates _base.html is the base template with different blocks. home.html can be used as an example on how to use the blocks.
Static files like css, js and images are in the folder /code/static.
The admin login can be found unter /backend.
Run the following command in your project directory:
docker compose exec web python manage.py makemessages -l de
This scans your project for strings marked for translation and creates a django.po file in the locale/de/LC_MESSAGES directory.
Open the django.po file, find your strings, and add the German translation.
docker compose exec web python manage.py compilemessages
Collect static files as preparation.
docker compose exec web python manage.py collectstatic
Build and push to Dockerhub.
docker build -f Dockerfile.prod -t luftdaten/datahub:tagname --platform linux/amd64 .
docker push luftdaten/datahub:tagname
Create docker-compose.prod.yml from example-docker-compose.prod.yml by setting the secret key. Then run:
docker compose -f docker-compose.prod.yml up -d
Open API Standard 3.1
/api/docs https://datahub.luftdaten.at/api/docs
This project is licensed under GNU General Public License v3.0.