2021-02-17 13:06:07 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
cat docker/settings_local.template.py | envsubst > re2o/settings_local.py
|
|
|
|
|
2021-08-09 09:04:39 +00:00
|
|
|
cp cotisations/templates/cotisations/invoice.html templates/default_invoice.html
|
|
|
|
cp cotisations/templates/cotisations/voucher.html templates/default_voucher.html
|
|
|
|
|
2021-02-17 13:06:07 +00:00
|
|
|
AUTOMIGRATE=${AUTOMIGRATE:-yes}
|
|
|
|
|
|
|
|
if [ "$AUTOMIGRATE" != "skip" ]; then
|
|
|
|
python3 manage.py migrate --noinput
|
|
|
|
fi
|
|
|
|
|
|
|
|
cat <<EOF | python manage.py shell
|
|
|
|
from django.contrib.auth import get_user_model
|
|
|
|
|
|
|
|
User = get_user_model()
|
|
|
|
|
|
|
|
User.objects.filter(pseudo='$SUPERUSER_LOGIN').exists() or \
|
|
|
|
User.objects.create_superuser(pseudo='$SUPERUSER_LOGIN', email='$SUPERUSER_EMAIL', password='$SUPERUSER_PASS', surname='$SUPERUSER_LOGIN')
|
|
|
|
EOF
|
|
|
|
python manage.py runserver 0.0.0.0:8000
|