diff --git a/bin/gunicorn_paste b/bin/gunicorn_paste index fd2b4464..1a485fa5 100644 --- a/bin/gunicorn_paste +++ b/bin/gunicorn_paste @@ -29,7 +29,7 @@ import os import pkg_resources import re import sys -from paste.deploy import loadapp +from paste.deploy import loadapp, loadwsgi from gunicorn.main import main __usage__ = "%prog [OPTIONS] APP_MODULE" @@ -55,6 +55,13 @@ def get_app(parser, opts, args): # add to eggs pkg_resources.working_set.add_entry(relative_to) + ctx = loadwsgi.loadcontext(loadwsgi.SERVER, config_url, + relative_to=relative_to) + debug = ctx.global_conf.get('debug') == "true" + if debug: + # we force to one worker in debug mode. + opts.workers = 1 + app = loadapp(config_url, relative_to=relative_to) return app diff --git a/examples/pylonstest/test.ini b/examples/pylonstest/test.ini index 200bd369..09c6b9d8 100644 --- a/examples/pylonstest/test.ini +++ b/examples/pylonstest/test.ini @@ -4,14 +4,14 @@ # The %(here)s variable will be replaced with the parent directory of this file # [DEFAULT] -debug = true +debug = false # Uncomment and replace with the address which should receive any error reports #email_to = you@yourdomain.com smtp_server = localhost error_email_from = paste@localhost [server:main] -use = egg:Paste#http +use = egg:gunicorn#main host = 127.0.0.1 port = 5000