Last active
March 21, 2022 11:19
-
-
Save ephdtrg/44c900ac703685eff6b64195d76425a9 to your computer and use it in GitHub Desktop.
Shell script for running Django in runserver / gunicorn mode, based on config.yaml parameter of DEBUG
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
source .env | |
debug=$(cat config.yaml | shyaml get-value debug) | |
echo "Starting server, debug mode: $debug" | |
if [ $debug = "True" ]; then | |
poetry run python manage.py runserver 0.0.0.0:$DJANGO_PORT | |
else | |
gunicorn --bind :$DJANGO_PORT --workers 8 project.wsgi:application | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment