diff piecrust/commands/builtin/admin.py @ 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 906cc2520773
children 59968ee07a07
line wrap: on
line diff
--- 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