You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
545 B

  1. #!/usr/bin/env bash
  2. set -o errexit
  3. app="/src/app"
  4. echo "Initializing database"
  5. python "${app}/manage.py" wait_for_db
  6. python "${app}/manage.py" migrate
  7. python "${app}/manage.py" create_roles
  8. if [[ -n "${ADMIN_USERNAME}" ]] && [[ -n "${ADMIN_PASSWORD}" ]] && [[ -n "${ADMIN_EMAIL}" ]]; then
  9. python "${app}/manage.py" create_admin \
  10. --username "${ADMIN_USERNAME}" \
  11. --password "${ADMIN_PASSWORD}" \
  12. --email "${ADMIN_EMAIL}" \
  13. --noinput \
  14. || true
  15. fi
  16. echo "Starting django"
  17. python -u "${app}/manage.py" runserver 0.0.0.0:8000