Modified start.sh to always perform migrations. This is useful when using docker-compose, since the database gets destroyed often with docker's workflow

pull/20/head
Piero Toffanin 2016-09-27 17:11:02 -04:00
rodzic 0759c6d441
commit 00801dd01f
1 zmienionych plików z 7 dodań i 8 usunięć

Wyświetl plik

@ -1,12 +1,11 @@
#!/bin/bash #!/bin/bash
if ! [ -a .initialized ]; then echo Running migrations
echo First run, migrating... python manage.py makemigrations
python manage.py makemigrations python manage.py migrate
python manage.py migrate
echo Creating default superuser... echo Creating default superuser...
echo "from django.contrib.auth.models import User; User.objects.create_superuser('admin', 'admin@example.com', 'admin')" | python manage.py shell
touch .initialized # This will fail if the user is a duplicate
fi echo "from django.contrib.auth.models import User; User.objects.create_superuser('admin', 'admin@example.com', 'admin')" | python manage.py shell
python manage.py runserver 0.0.0.0:8000 python manage.py runserver 0.0.0.0:8000