Created
October 26, 2013 11:42
-
-
Save lcruz/7168520 to your computer and use it in GitHub Desktop.
Gunicron start with DJango + Gevent Socket IO
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 | |
set -e | |
LOGFILE=/path/to/log/logfile.log | |
LOGDIR=$(dirname $LOGFILE) | |
NUM_WORKERS=1 | |
PORT=8000 | |
BIND_IP=127.0.0.1:$PORT | |
USER=www | |
GROUP=www | |
# switch to project dir, activate virtual environment | |
cd /path/to/site | |
source /path/to/virtualenv/bin/activate | |
export PYTHON_PATH=$PYTHON_PATH:/path/to/site | |
test -d $LOGDIR || mkdir -p $LOGDIR | |
exec gunicorn --worker-class socketio.sgunicorn.GeventSocketIOWorker --workers $NUM_WORKERS \ | |
--user=$USER --group=$GROUP --log-level=debug \ | |
--log-file=$LOGFILE 2>>$LOGFILE -b $BIND_IP module.wsgi:application |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment