mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
fix config path and make sure we can use it in django admin command too
This commit is contained in:
parent
3ba5df758e
commit
756d74ed0d
@ -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']:
|
||||
|
||||
@ -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'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user