Update entrypoint to create user on startup

This commit is contained in:
Pavle Portic 2019-03-26 04:34:02 +01:00
parent d6026330de
commit 44a9d59d66
Signed by: TheEdgeOfRage
GPG Key ID: 6758ACE46AA2A849
1 changed files with 6 additions and 0 deletions

View File

@ -9,6 +9,12 @@
sleep 5
python manage.py migrate
echo "from django.contrib.auth.models import User; User.objects.create_superuser('${DJANGO_ADMIN_USER}', '${DJANGO_ADMIN_MAIL}', '${DJANGO_ADMIN_PASS}')" | python manage.py shell
echo " \
from perks.models import User; \
from django.contrib.auth.models import User as AuthUser; \
base_user = AuthUser.objects.get(id=1) \
user = User(base_user=base_user) \
user.save()" | python manage.py shell
gunicorn -w 4 --bind 0.0.0.0:80 perktree.wsgi:application