add a temp file to mark the first run
This commit is contained in:
parent
e5396aea5f
commit
8f852733ef
|
@ -172,3 +172,4 @@ db.sqlite3
|
||||||
.vscode/
|
.vscode/
|
||||||
.pytest_cache/
|
.pytest_cache/
|
||||||
htmlcov/
|
htmlcov/
|
||||||
|
.second_run
|
||||||
|
|
3
run.sh
3
run.sh
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
cd network_inventory
|
cd network_inventory
|
||||||
if [ -f ./network_inventory/db.sqlite3 ]; then
|
if [ -f ./.second_run ]; then
|
||||||
python manage.py makemigrations
|
python manage.py makemigrations
|
||||||
python manage.py migrate
|
python manage.py migrate
|
||||||
else
|
else
|
||||||
|
@ -8,5 +8,6 @@ else
|
||||||
python manage.py migrate
|
python manage.py migrate
|
||||||
python manage.py loaddata inventory
|
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')"
|
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
|
fi
|
||||||
python manage.py runserver 0.0.0.0:8000
|
python manage.py runserver 0.0.0.0:8000
|
||||||
|
|
Loading…
Reference in New Issue