fix config path and make sure we can use it in django admin command too

This commit is contained in:
benoitc 2010-02-23 15:39:18 +01:00
parent 3ba5df758e
commit 756d74ed0d
2 changed files with 7 additions and 5 deletions

View File

@ -109,7 +109,7 @@ def main(usage, get_app):
opts, args = parser.parse_args()
app = get_app(parser, opts, args)
conf = Config(opts.__dict__)
conf = Config(opts.__dict__, opts.config)
arbiter = Arbiter(conf.address, conf.workers, app, config=conf,
debug=conf['debug'], pidfile=conf['pidfile'])
if conf['daemon']:

View File

@ -24,13 +24,15 @@ class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('--adminmedia', dest='admin_media_path', default='',
help='Specifies the directory from which to serve admin media.'),
make_option('-w', '--workers', dest='workers', default='1',
make_option('-c', '--config', dest='gconfig', type='string',
help='Gunicorn Config file. [%default]'),
make_option('-w', '--workers', dest='workers',
help='Specifies the number of worker processes to use.'),
make_option('--pid', dest='pidfile', default='',
make_option('--pid', dest='pidfile',
help='set the background PID file'),
make_option( '--daemon', dest='daemon', action="store_true",
help='Run daemonized in the background.'),
make_option('--umask', dest='umask', type='int',
make_option('--umask', dest='umask',
help="Define umask of daemon process"),
make_option('-u', '--user', dest="user",
help="Change worker user"),
@ -53,7 +55,7 @@ class Command(BaseCommand):
if not options.get('proc_name'):
options['proc_name'] =settings.SETTINGS_MODULE
conf = Config(options)
conf = Config(options, options.get('gconfig'))
admin_media_path = options.get('admin_media_path', '')
quit_command = (sys.platform == 'win32') and 'CTRL-BREAK' or 'CONTROL-C'