Sunday, 29 September 2013

Django, gunicorn, upstart Failed to find application

Django, gunicorn, upstart Failed to find application

I'm trying to run Django website with Gunicorn as a service through
Upstart. I have the following init.sh script in my django instance (in the
same dir as manage.py). When I exec the gunicorn get started with all
configured workers and etc. The problem comes when I try to start it
through the upstart.
init.sh
'#!/bin/bash'
set -e
LOGFILE=/var/log/gunicorn/hello.log
LOGDIR=$(dirname $LOGFILE)
NUM_WORKERS=3
# user/group to run as
USER=www-data
GROUP=www-data
cd /opt/defenv/market
source ../bin/activate
test -d $LOGDIR || mkdir -p $LOGDIR
exec ../bin/gunicorn marketsite.wsgi -w $NUM_WORKERS
--user=$USER --group=$GROUP --log-level=debug
--log-file=$LOGFILE 2>>$LOGFILE -n market
/etc/init.d/market.conf
debug = True
loglevel = debug
description "Market Site"
start on runlevel [2345]
stop on runlevel [06]
#respawn
#respawn limit 10 5
exec /opt/defenv/market/init.sh

No comments:

Post a Comment