diff --git a/tools/run-dev.py b/tools/run-dev.py index 8026d47f37..d0366758bc 100755 --- a/tools/run-dev.py +++ b/tools/run-dev.py @@ -37,6 +37,10 @@ parser.add_option('--test', action='store_true', dest='test', help='Use the testing database and ports') +parser.add_option('--interface', + action='store', dest='interface', + default='127.0.0.1', help='Set the interface for the proxy to listen on') + (options, args) = parser.parse_args() base_port = 9991 @@ -95,11 +99,7 @@ class Resource(resource.Resource): return proxy.ReverseProxyResource('localhost', django_port, '/'+name) try: - try: - interface = sys.argv[1] - except IndexError: - interface = '127.0.0.1' - reactor.listenTCP(proxy_port, server.Site(Resource()), interface=interface) + reactor.listenTCP(proxy_port, server.Site(Resource()), interface=options.interface) reactor.run() except: # Print the traceback before we get SIGTERM and die.