mirror of
https://github.com/lucaspalomodevelop/eventcally.git
synced 2026-03-13 00:07:22 +00:00
1.4 KiB
1.4 KiB
Development
Docker
Compose (including dependencies)
docker-compose up --build
Build image
docker build -t eventcally/eventcally:latest .
Run container with existing postgres server
docker run -p 5000:5000 -e "DATABASE_URL=postgresql://postgres@host.docker.internal/eventcally" eventcally/eventcally:latest
Tests
Create test database
psql -c 'create database eventcally_tests;' -U postgres
psql -c 'create extension postgis;' -d eventcally_tests -U postgres
Run tests
pytest
With coverage:
pytest --cov-report=html --cov=project
Database
Create new revision
flask db migrate
Upgrade database
flask db upgrade
i18n
https://pythonhosted.org/Flask-BabelEx/
Init
pybabel extract -F babel.cfg -o messages.pot . && pybabel extract -F babel.cfg -k lazy_gettext -o messages.pot . && pybabel init -i messages.pot -d project/translations -l de
Add locale
pybabel init -i messages.pot -d project/translations -l en
Extract new msgid's and merge into *.po files
pybabel extract -F babel.cfg -o messages.pot . && pybabel extract -F babel.cfg -k lazy_gettext -o messages.pot . && pybabel update -N -i messages.pot -d project/translations
Compile after translation is done
pybabel compile -d project/translations
Celery
dotenv run celery -A project.celery purge