Update readme. Make Makefile more nice.
This commit is contained in:
parent
cf33b95201
commit
0bad2a599c
8
Makefile
8
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
|
DOCKER_BUILD = DOCKER_BUILDKIT=1 docker build
|
||||||
MANAGE = ${DOCKER_RUN} backend python /app/src/manage.py
|
MANAGE = ${DOCKER_RUN} backend python /app/src/manage.py
|
||||||
|
|
||||||
|
@ -31,3 +31,9 @@ manage_command:
|
||||||
|
|
||||||
test:
|
test:
|
||||||
${DOCKER_RUN} backend pytest src/
|
${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}
|
||||||
|
|
33
README.md
33
README.md
|
@ -1,24 +1,35 @@
|
||||||
# member.data.coop
|
# member.data.coop
|
||||||
|
|
||||||
To start developing:
|
## Development requirements
|
||||||
|
|
||||||
Get poetry
|
- Docker
|
||||||
|
- Docker compose
|
||||||
|
- pre-commit (preferred for contributions)
|
||||||
|
|
||||||
$ python3 -m pip install --user pipx
|
## Start local server
|
||||||
$ pipx install poetry
|
|
||||||
|
|
||||||
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
|
$ make test
|
||||||
|
|
Loading…
Reference in a new issue