startup.sh 696 Bytes
Newer Older
1 2 3 4
until nc -z db 3306; do
    echo "waiting for database to start..."
    sleep 1
done
5

6
export GO_SECRET_KEY=$(dd if=/dev/urandom count=100 | tr -dc "A-Za-z0-9" | fold -w 60 | head -n1 2>/dev/null)
7 8 9
python go/manage.py flush --no-input
python go/manage.py makemigrations
python go/manage.py makemigrations go
10
python go/manage.py migrate
11
python go/manage.py createsuperuser --noinput --username=$superuser --email=$superuser$GO_EMAIL_DOMAIN
12
echo "from django.contrib.auth import get_user_model; User = get_user_model(); me = User.objects.get(username='$superuser'); me.first_name = 'David'; me.last_name = 'Haynes'; me.save(); " | python go/manage.py shell
13
python go/manage.py runserver 0.0.0.0:8000