Backend repository for parking permits service developed by 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, copy and rename .env.example
to .env
.
You'll need a redhat developer account to gain access to RedHat subscriptions needed to run the docker image.
Register at https://developers.redhat.com/register and confirm your email address.
Set following environment variables in .env file:
- BUILD_MODE=local
- REDHAT_USERNAME=your redhat account username
- REDHAT_PASSWORD=your redhat account password
Then you can run docker image with:
docker-compose up
-
Access development server on localhost:8000
-
Login to admin interface with
admin
and 🥥 -
Done!
pyenv install -v 3.9.0
pyenv virtualenv 3.9.0 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: