Backend for all CPC related apps, written in Python.
- Poetry
- Python3.10
- Doppler CLI
- Access to our secrets too
- Docker (if you want to run it in a container)
- Redis (for CRON jobs)
brew install poetry
brew install [email protected]
brew install doppler
brew install libpq # install only the postgresql libs not fully (if you want to use docker)
## This might be different.
sudo ln -s $(brew --prefix)/opt/libpq/bin/psql /usr/local/bin/psql
Figure it out yourself, or ask for help.
# Start the DB and Redis :)
docker-compose up postgres redis -d
poetry install --with dev
- Run with doppler (many environment variables are required)
- Run locally
- Run infra with docker-compose
- Test manually with your own telegram bot
poetry run python manage.py runserver
doppler run -- poetry run python manage.py runserver
# for some reason on macOS:
# you need to run this command with the --pool=solo
# on production it runs without it
doppler run -- poetry run celery -A cpc worker --loglevel=info --pool=solo
doppler run -- poetry run python manage.py run_telegram_bot
BEWARE: Requires a doppler token, get it from doppler.
docker-compose up app
Currently using unittest
to write tests, nothing fancy just to fix bugs that appears from time to time.
doppler run -- poetry run python manage.py test
Should be done automatically by github actions.