From 0bad2a599c69f86ad71fe5b9429e0433ed8cd8d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=AD=C3=B0ir=20Valberg=20Gu=C3=B0mundsson?= Date: Mon, 1 Mar 2021 00:15:01 +0100 Subject: [PATCH] Update readme. Make Makefile more nice. --- Makefile | 8 +++++++- README.md | 33 ++++++++++++++++++++++----------- 2 files changed, 29 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index 255a46c..7a3a854 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -DOCKER_RUN = docker-compose run +DOCKER_RUN = docker-compose run -e UID=`id -u` -e GID=`id -g` DOCKER_BUILD = DOCKER_BUILDKIT=1 docker build MANAGE = ${DOCKER_RUN} backend python /app/src/manage.py @@ -31,3 +31,9 @@ manage_command: test: ${DOCKER_RUN} backend pytest src/ + +add_dependency: + ${DOCKER_RUN} backend poetry add --lock ${DEPENDENCY} + +add_dev_dependency: + ${DOCKER_RUN} backend poetry add -D --lock ${DEPENDENCY} diff --git a/README.md b/README.md index a93d8f2..5112376 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,35 @@ # member.data.coop -To start developing: +## Development requirements -Get poetry +- Docker +- Docker compose +- pre-commit (preferred for contributions) - $ python3 -m pip install --user pipx - $ pipx install poetry +## Start local server -Run poetry to setup environment +Given that the requirements above are installed, it should be as easy as: - $ poetry install + $ make migrate -Run this make target, which installs all the requirements and sets up a development database. +This will setup the database. Next run: - $ make dev-setup + $ make run -To run the Django development server: +This will build the docker image and start the member system on http://localhost:8000. - $ poetry run python manage.py runserver +You can create a superuser by running: -Before you push your stuff, run tests: + $ make createsuperuser + +Make migrations: + + $ make makemigrations + +Make messages: + + $ make makemessages + +Running tests: $ make test