From 8f852733ef1e5206a14b690f40a9bbc0a0130c2a Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Sat, 10 Aug 2019 15:03:03 +0200 Subject: [PATCH] add a temp file to mark the first run --- .gitignore | 1 + run.sh | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 52a05cc..8b78032 100644 --- a/.gitignore +++ b/.gitignore @@ -172,3 +172,4 @@ db.sqlite3 .vscode/ .pytest_cache/ htmlcov/ +.second_run diff --git a/run.sh b/run.sh index 7d5094e..e9d7449 100755 --- a/run.sh +++ b/run.sh @@ -1,6 +1,6 @@ #!/bin/bash cd network_inventory -if [ -f ./network_inventory/db.sqlite3 ]; then +if [ -f ./.second_run ]; then python manage.py makemigrations python manage.py migrate else @@ -8,5 +8,6 @@ else python manage.py migrate python manage.py loaddata inventory python manage.py shell -c "from django.contrib.auth import get_user_model; User = get_user_model(); User.objects.create_superuser('admin', 'admin@example.com', 'password')" + touch .second_run fi python manage.py runserver 0.0.0.0:8000