s/workerclass/worker_class & fix gunicorn django

This commit is contained in:
benoitc 2010-04-22 21:56:37 +02:00
parent 9409839668
commit 40e5751fb7
2 changed files with 7 additions and 5 deletions

View File

@ -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)

View File

@ -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: