Created
November 4, 2016 07:43
-
-
Save renesansz/c1d60619030b4972cf1dc8165d86405c to your computer and use it in GitHub Desktop.
Script for running Django in web server
This file contains hidden or 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 | |
set -e | |
LOGFILE=/opt/dti-sordas/logs/gunicorn.log | |
LOGDIR=$(dirname $LOGFILE) | |
TIMEOUT=300 | |
NUM_WORKERS=1 | |
cd /opt/dti-sordas/dti-sordas | |
source ../env/bin/activate | |
test -d $LOGDIR || mkdir -p $LOGDIR | |
#export DJANGO_SETTINGS_MODULE="src.sordas.settings" | |
cd /opt/dti-sordas/dti-sordas/src | |
exec /opt/dti-sordas/env/bin/gunicorn -b unix:/tmp/dti-sordas.sock -t $TIMEOUT -w $NUM_WORKERS --log-file=$LOGFILE sordas.wsgi:application |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment