The safe-config-service
is a service that provides configuration information in the context of the Safe clients environment (eg.: list of available safe apps and chain metadata).
docker-compose
– https://docs.docker.com/compose/install/- Python 3.12.2
In order to start the server application:
python -m venv venv # creates a virtual environment venv in the local directory
source venv/bin/activate
pip install -r requirements-dev.txt
pip install setuptools
docker compose up -d db
python src/manage.py migrate
The admin interface of the service will be available under http://localhost:8000/admin
but you need to have an admin registered before you are able to access the panel.
To create an admin user:
python src/manage.py createsuperuser
python src/manage.py runserver
By default the service will be available under http://127.0.0.1:8000/
The service is already configured for development purposes however if you wish to deploy it in a production environment you should set some sensitive parameters such as: POSTGRES_USER
, POSTGRES_PASSWORD
, SECRET_KEY
.
DEBUG
should be set to false
.
We provide the .dev.env
file which explains the role of each environment variable. You can set the configuration using this file and read it in terminal session where the application will be
executed.
Pytest is used to run the available tests in the project. Some of these tests validate the integration with the database so having one running is required. From the project root:
docker compose up -d db
pytest src
Code formatting and linting are enforced before every commit using pre-commit
.
To manually trigger the checks, run:
pre-commit run --all-files