Skip to content

Instantly share code, notes, and snippets.

@lcruz
Created October 26, 2013 11:42
Show Gist options
  • Save lcruz/7168520 to your computer and use it in GitHub Desktop.
Save lcruz/7168520 to your computer and use it in GitHub Desktop.
Gunicron start with DJango + Gevent Socket IO
#!/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