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