From 88e15974dcc086b4ad2066bdd4fa4735c14471fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=AD=C3=B0ir=20Valberg=20Gu=C3=B0mundsson?= Date: Mon, 2 Oct 2023 20:10:24 +0200 Subject: [PATCH] Fixing some stuff with README --- env => .env.example | 2 ++ README.md | 40 ++++++++++++++++++++++++++++++++++++++-- docker-compose.yml | 4 ++-- 3 files changed, 42 insertions(+), 4 deletions(-) rename env => .env.example (57%) diff --git a/env b/.env.example similarity index 57% rename from env rename to .env.example index 86933bf..777e8f3 100644 --- a/env +++ b/.env.example @@ -3,5 +3,7 @@ POSTGRES_HOST=postgres POSTGRES_PASSWORD=postgres POSTGRES_PORT=5432 DATABASE_URL=postgres://postgres:postgres@postgres:5432/postgres +# Use something along the the following if you are not using docker +# DATABASE_URL=postgres://postgres:postgres@localhost:5432/datacoop_membersystem DEBUG=True DJANGO_ENV=development diff --git a/README.md b/README.md index 5112376..9aed72b 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,22 @@ # member.data.coop -## Development requirements +## Development + +### Setup environment + +Copy over the .env.example file to .env and adjust DATABASE_URL accordingly + + $ cp .env.example .env + +### Docker + +#### Requirements - Docker - Docker compose - pre-commit (preferred for contributions) -## Start local server +#### Setup Given that the requirements above are installed, it should be as easy as: @@ -33,3 +43,29 @@ Make messages: Running tests: $ make test + +### Non-docker + +Create a venv + + $ python3 -m venv venv + +Activate the venv + + $ source venv/bin/activate + +Install requirements + + $ pip install -r requirements/dev.txt + +Run migrations + + $ ./src/manage.py migrate + +Create a superuser + + $ ./src/manage.py createsuperuser + +Run the server + + $ ./src/manage.py runserver diff --git a/docker-compose.yml b/docker-compose.yml index b3ec37b..6872ac9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -15,7 +15,7 @@ services: depends_on: - postgres env_file: - - env + - .env postgres: image: postgres:13-alpine @@ -24,7 +24,7 @@ services: ports: - 5432:5432 env_file: - - env + - .env volumes: postgres_data: