add a temp file to mark the first run

This commit is contained in:
Andreas Zweili 2019-08-10 15:03:03 +02:00
parent e5396aea5f
commit 8f852733ef
2 changed files with 3 additions and 1 deletions

1
.gitignore vendored
View File

@ -172,3 +172,4 @@ db.sqlite3
.vscode/
.pytest_cache/
htmlcov/
.second_run

3
run.sh
View File

@ -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