Backend repository for parking permits service in City of Helsinki.
Instructions in this README.md are written with an experienced Python developer in mind. For example, "docker-compose up" means you already know what docker and docker-compose are, and you already have both installed locally. This helps to keep the README.md concise.
In order to create placeholder for your own environment variables file, make a local .env.template copy:
$ cp .env.template .envThen you can run docker image with:
docker-compose up-
Access development server on localhost:8888
-
Login to admin interface with
adminand 🥥 -
Done!
- pyenv
- virtualenvwrapper
- pyenv-virtualenvwrapper
pyenv install -v 3.12.9
pyenv virtualenv 3.12.9 parking_permits
pyenv local parking_permits
pyenv virtualenvwrapper
Install packages
pip install -U pip pip-tools
pip-compile -U requirements.in
pip-compile -U requirements-dev.in
pip-sync requirements.txt requirements-dev.txt
-
We use
pip-toolsto manage python packages we need -
After adding a new package to requirements(-dev).in file, compile it and re-build the Docker image so that the container would have access to the new package
docker-compose up --build
-
You can run all the tests with:
docker-compose exec api pytest -
If you want to run the tests continously while developing:
Testing emails locally with Mailpit
- Start Mailpit with
docker compose up mailpit - In your
.envfile, setEMAIL_HOST=0.0.0.0,EMAIL_PORT=1025andDEBUG_MAILPIT=True - Emails sent by the application will be visible in Mailpit's web interface at localhost:8025