From 675186cc0bea9562d32ca2ad581add8f5d7fbfae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Snorre=20S=C3=A6ther?= Date: Tue, 7 Nov 2023 21:48:03 +0100 Subject: [PATCH 1/4] changed one title and improved seeding docs --- README.md | 2 +- docs/technical/backend/seed.md | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index f9254371d..0e614fb50 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ - [Work Methodology](/docs/work-methodology.md) - [Useful Commands](/docs/useful-commands.md) - [Technologies used on Samf4 🤖](/docs/technical/Samf4Tech.md) -- [Useful Docker aliases](/docs/docker-project-specific-commands.md) +- [Project Specific Commands](/docs/docker-project-specific-commands.md) ## Installation We have a script that handles all installation for you. To run the script, a Github Personal Access Token (PAT) is required. diff --git a/docs/technical/backend/seed.md b/docs/technical/backend/seed.md index cf118cb9d..440460e40 100644 --- a/docs/technical/backend/seed.md +++ b/docs/technical/backend/seed.md @@ -4,9 +4,9 @@ Seed scripts are used to populate the database with dummy data for testing. Seed scripts are located in `root/management/commands/seed_scripts/`. -### Seeding commands +### Seeding loccaly -To seed the database locally, run this in terminal: +To seed the database **locally**, run this in terminal: - `python manage.py seed` @@ -19,19 +19,19 @@ For instance, to seed events run: - `python manage.py seed events` ### Seeding in docker - -After docker container is running, send command to the container: - + +After docker container is running: -- Go into docker: `docker exec backend bash` -- Enable pipenv: `pipenv shell` -- Run seed script: `python manage.py seed` +- 1) Open shell in Docker container: `docker compose exec backend bash` +- 2) Enable pipenv: `pipenv shell` +- 3) Run seed script: `python manage.py seed` -### Adding/changing seed scripts +❗️On mac you might need to use `docker compose-exec backend bash` in step 1 +### Adding/changing seed scripts The seed script `seed.py` does not need to be modified to add new seed scripts. Instead, add scripts inside the `seed_scripts/` folder. In order for them to be detected, you must include it in the `seed_scripts/__init__.py` file: From bcdb38f304bd9093d344efe6342b598e7e355dfe Mon Sep 17 00:00:00 2001 From: magsyg Date: Mon, 18 Dec 2023 14:11:34 +0100 Subject: [PATCH 2/4] loccaly --- docs/technical/backend/seed.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/technical/backend/seed.md b/docs/technical/backend/seed.md index 440460e40..1e13f90ed 100644 --- a/docs/technical/backend/seed.md +++ b/docs/technical/backend/seed.md @@ -4,7 +4,7 @@ Seed scripts are used to populate the database with dummy data for testing. Seed scripts are located in `root/management/commands/seed_scripts/`. -### Seeding loccaly +### Seeding locally To seed the database **locally**, run this in terminal: From 7a0787f878e55349ccac733bdfa788dcbae5b0bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Snorre=20S=C3=A6ther?= Date: Tue, 9 Jan 2024 19:04:05 +0100 Subject: [PATCH 3/4] rectified 'docker compose exec backend bash' --- docs/technical/backend/seed.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/technical/backend/seed.md b/docs/technical/backend/seed.md index 440460e40..cebe7287a 100644 --- a/docs/technical/backend/seed.md +++ b/docs/technical/backend/seed.md @@ -29,7 +29,7 @@ After docker container is running: - 2) Enable pipenv: `pipenv shell` - 3) Run seed script: `python manage.py seed` -❗️On mac you might need to use `docker compose-exec backend bash` in step 1 +❗️Some Docker versiones might require `docker compose exec backend bash` at step 1 ### Adding/changing seed scripts The seed script `seed.py` does not need to be modified to add new seed scripts. From 53aa0afa18737eb1415c72d727683df0b27bb1cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Snorre=20S=C3=A6ther?= Date: Tue, 16 Jan 2024 19:25:37 +0100 Subject: [PATCH 4/4] removed line --- docs/technical/backend/seed.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/technical/backend/seed.md b/docs/technical/backend/seed.md index 62196542c..d9f002a55 100644 --- a/docs/technical/backend/seed.md +++ b/docs/technical/backend/seed.md @@ -29,7 +29,6 @@ After docker container is running: - 2) Enable pipenv: `pipenv shell` - 3) Run seed script: `python manage.py seed` -❗️Some Docker versiones might require `docker compose exec backend bash` at step 1 ### Adding/changing seed scripts The seed script `seed.py` does not need to be modified to add new seed scripts.