This repository is for the backend django part of the statistiek-hub: a Management module for publishing statistics from the Research and Statistics Department of the municipality of Amsterdam
See the Makefile in this project for the description of relevant commands.
-
From the root directory run:
make build
Note: If you get the error:
Got permission denied while trying to connect to the Docker daemon socket
Try one of these options:
-
Manage docker as a non-root user:
Create the docker group:
sudo groupadd docker
Add your user to the docker group
sudo usermod -aG docker $USER
Log out and in so that your group membership is re-evaluated.
-
or set read-write permissions to
docker.sock
:sudo chmod 666 /var/run/docker.sock
-
-
Apply migrations:
make migrate
Note: If you get the warning that database structure is out-of-date, then first make migrations before applying them:
make migrations
-
Check if the build worked
make dev
-
When you confirm the successful build, stop the running container with
Ctrl-C
and fill the database with testdatamake load_fixtures
-
Last, when you want to add a super-user for django admin, go to the terminal of the backend docker container
python manage.py createsuperuser
-
Now all is set and you can run the Composer
make dev
Test your development environment on localhost:8000/admin.