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 .env
Then you can run docker image with:
docker-compose up
-
Access development server on localhost:8888
-
Login to admin interface with
admin
and 🥥 -
Done!
pyenv install -v 3.11.9
pyenv virtualenv 3.11.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-tools
to 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 graphql-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
.env
file, setEMAIL_HOST=0.0.0.0
,EMAIL_PORT=1025
andDEBUG_MAILPIT=True
- Emails sent by the application will be visible in Mailpit's web interface at localhost:8025