From 5b72e50042f2d12f5380fd3227beec8d3084f8e8 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sun, 18 Jul 2010 14:40:09 -0400 Subject: [PATCH] Add options to specify binding address and port. --- dirtag/web.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dirtag/web.py b/dirtag/web.py index 4c4cd43..3826022 100755 --- a/dirtag/web.py +++ b/dirtag/web.py @@ -146,6 +146,12 @@ if __name__ == '__main__': parser.add_option('-s', '--static-dir', dest='static_dir', metavar='DIR', default='static', help='Location of static files (%default)') + parser.add_option('-a', '--address', dest='address', default='127.0.0.1', + metavar='IP', + help='address that the server will bind to') + parser.add_option('-p', '--port', dest='port', default='8080', + metavar='PORT', + help='port that the server will listen on') parser.add_option('-n', '--name', dest='name', metavar='STRING', default='dirtag', help='Name of the dirtag repository') @@ -163,6 +169,8 @@ if __name__ == '__main__': w = WebInterface( d, template_dir=options.template_dir, repository_name=options.name) cherrypy.config.update({ + 'server.socket_host': options.address, + 'server.socket_port': int(options.port), 'tools.encode.on': True, 'tools.encode.encoding': 'utf8', }) -- 2.26.2