Mercurial > piecrust2
changeset 619:200c7063affa
admin: Change the default admin server port to 8090, add `--port` option.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sat, 06 Feb 2016 21:47:24 -0800 |
parents | 477dc9a63222 |
children | c2708f20a87b |
files | foodtruck/main.py piecrust/commands/builtin/admin.py |
diffstat | 2 files changed, 14 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/foodtruck/main.py Sat Feb 06 21:34:23 2016 -0800 +++ b/foodtruck/main.py Sat Feb 06 21:47:24 2016 -0800 @@ -4,14 +4,14 @@ logger = logging.getLogger(__name__) -def run_foodtruck(debug=False): +def run_foodtruck(host=None, port=None, debug=False): if debug: import foodtruck.settings foodtruck.settings.DEBUG = debug from .web import app try: - app.run(debug=debug, threaded=True) + app.run(host=host, port=port, debug=debug, threaded=True) except SystemExit: # This is needed for Werkzeug's code reloader to be able to correctly # shutdown the child process in order to restart it (otherwise, SSE
--- a/piecrust/commands/builtin/admin.py Sat Feb 06 21:34:23 2016 -0800 +++ b/piecrust/commands/builtin/admin.py Sat Feb 06 21:47:24 2016 -0800 @@ -31,6 +31,14 @@ p = subparsers.add_parser( 'run', help="Runs the administrative panel website.") + p.add_argument( + '-p', '--port', + help="The port for the administrative panel website.", + default=8090) + p.add_argument( + '-a', '--address', + help="The host for the administrative panel website.", + default='localhost') p.set_defaults(sub_func=self._runFoodTruck) def checkedRun(self, ctx): @@ -43,7 +51,10 @@ settings.FOODTRUCK_CMDLINE_MODE = True settings.FOODTRUCK_ROOT = ctx.app.root_dir from foodtruck.main import run_foodtruck - run_foodtruck(debug=ctx.args.debug) + run_foodtruck( + host=ctx.args.address, + port=ctx.args.port, + debug=ctx.args.debug) def _initFoodTruck(self, ctx): import getpass