diff --git a/gunicorn/main.py b/gunicorn/main.py index bf6fb445..9b8e1dcb 100644 --- a/gunicorn/main.py +++ b/gunicorn/main.py @@ -33,7 +33,7 @@ def options(): help='Adress to listen on. Ex. 127.0.0.1:8000 or unix:/tmp/gunicorn.sock'), op.make_option('-w', '--workers', dest='workers', help='Number of workers to spawn. [1]'), - op.make_option('-k', '--worker-class', dest='workerclass', + op.make_option('-k', '--worker-class', dest='worker_class', help="The type of request processing to use "+ "[egg:gunicorn#sync]"), op.make_option('-p','--pid', dest='pidfile', @@ -76,7 +76,7 @@ def main(usage, get_app): else: os.setpgrp() configure_logging(cfg) - + Arbiter(cfg, app).run() def run(): @@ -140,6 +140,8 @@ def run_django(): # django wsgi app return django.core.handlers.wsgi.WSGIHandler() + + main("%prog [OPTIONS] [SETTINGS_PATH]", get_app) diff --git a/gunicorn/management/commands/run_gunicorn.py b/gunicorn/management/commands/run_gunicorn.py index e574300c..43ba1c4a 100644 --- a/gunicorn/management/commands/run_gunicorn.py +++ b/gunicorn/management/commands/run_gunicorn.py @@ -15,6 +15,7 @@ from django.utils import translation from django.core.servers.basehttp import AdminMediaHandler, WSGIServerException from django.core.handlers.wsgi import WSGIHandler +from gunicorn.arbiter import Arbiter from gunicorn.config import Config from gunicorn.main import daemonize, configure_logging @@ -24,7 +25,7 @@ class Command(BaseCommand): help='Specifies the directory from which to serve admin media.'), make_option('-c', '--config', dest='gconfig', type='string', help='Gunicorn Config file. [%default]'), - make_option('-k', '--worker-class', dest='workerclass', + make_option('-k', '--worker-class', dest='worker_class', help="The type of request processing to use "+ "[egg:gunicorn#sync]"), make_option('-w', '--workers', dest='workers', @@ -72,8 +73,7 @@ class Command(BaseCommand): try: handler = AdminMediaHandler(WSGIHandler(), admin_media_path) - arbiter = conf.arbiter(conf.address, conf.workers, handler, - pidfile=conf['pidfile'], config=conf) + arbiter = Arbiter(conf, handler) if conf['daemon']: daemonize() else: