From 858e9420acf8d962c7f4df0bd6419a88b298e26c Mon Sep 17 00:00:00 2001 From: QuitoTactico Date: Thu, 14 Nov 2024 19:20:33 -0500 Subject: [PATCH] some guides and dockerfile updates --- GUIDES AND RULES/upload_database.txt | 16 ++++++++++++++++ docker-compose.yml | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 GUIDES AND RULES/upload_database.txt diff --git a/GUIDES AND RULES/upload_database.txt b/GUIDES AND RULES/upload_database.txt new file mode 100644 index 0000000..56388b7 --- /dev/null +++ b/GUIDES AND RULES/upload_database.txt @@ -0,0 +1,16 @@ +#### EC2 +docker ps +docker exec -it /bin/bash + +#### container +python manage.py dumpdata --settings=SoftServeAcademy.settings > data.json +python manage.py migrate --settings=SoftServeAcademy.settings_deployment +python manage.py shell --settings=SoftServeAcademy.settings_deployment + +#### py console +from django.contrib.contenttypes.models import ContentType +ContentType.objects.all().delete() +exit() + +#### container again +python manage.py loaddata data.json --settings=SoftServeAcademy.settings_deployment diff --git a/docker-compose.yml b/docker-compose.yml index 230a5a0..5cf74bf 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ services: web: image: quitotactico/softserve-academy - command: ["sh", "/app/scripts/init.sh"] + command: ["sh", "/scripts/init.sh"] environment: - DJANGO_SETTINGS_MODULE=SoftServeAcademy.settings_deployment depends_on: