From fd3180445fa198197e56e6829520aa35e809008d Mon Sep 17 00:00:00 2001 From: benoitc Date: Wed, 11 Dec 2013 11:16:25 +0100 Subject: [PATCH] django run_command: remove addr once parsed. fix #577 --- gunicorn/management/commands/run_gunicorn.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gunicorn/management/commands/run_gunicorn.py b/gunicorn/management/commands/run_gunicorn.py index e27e6598..6a69be85 100644 --- a/gunicorn/management/commands/run_gunicorn.py +++ b/gunicorn/management/commands/run_gunicorn.py @@ -4,6 +4,7 @@ # See the NOTICE for more information. from optparse import make_option +import sys from django.core.management.base import BaseCommand, CommandError @@ -109,7 +110,9 @@ class Command(BaseCommand): raise CommandError('Usage is run_gunicorn %s' % self.args) if addrport: + sys.argv = sys.argv[:-1] options['bind'] = addrport admin_media_path = options.pop('admin_media_path', '') + DjangoApplicationCommand(options, admin_media_path).run()