On Sun, Aug 19, 2012 at 7:27 PM, Mark Huang <zhengha...
> Oh yeah....that's actually what I'm doing right now, but I just thought
> there was a way to "Python-ize" it like that running.py script.
Something like this should do the trick:
from gunicorn.app.pasterapp import paste_server
from paste.deploy app_config, load_app
app = loadapp('config:production.ini', relative_to='.')
paste_server(app, host='0.0.0.0', port=port, ...)
Other kwargs available to paste_server are 'workers', 'bind', 'user',
'group', 'proc_name', and 'logger_class' (properties from
You can also pass a global config from paster as the second argument
(such as if you did appconfig() instead of loadapp()), but I'm not
sure it's necessary to pass to gunicorn for any reason.