comparison piecrust/commands/builtin/serving.py @ 135:50b65c700c96

Don't use Werkzeug's reloader in non-debug mode unless we ask for it.
author Ludovic Chabant <ludovic@chabant.com>
date Tue, 25 Nov 2014 22:37:06 -0800
parents f485ba500df3
children f3aa511eef99
comparison
equal deleted inserted replaced
134:742009d964ef 135:50b65c700c96
17 help="The port for the web server", 17 help="The port for the web server",
18 default=8080) 18 default=8080)
19 parser.add_argument('-a', '--address', 19 parser.add_argument('-a', '--address',
20 help="The host for the web server", 20 help="The host for the web server",
21 default='localhost') 21 default='localhost')
22 parser.add_argument('--use-reloader',
23 help="Restart the server when PieCrust code changes",
24 action='store_true')
22 25
23 def run(self, ctx): 26 def run(self, ctx):
24 server = Server( 27 server = Server(
25 ctx.app.root_dir, 28 ctx.app.root_dir,
26 host=ctx.args.address, 29 host=ctx.args.address,
27 port=ctx.args.port, 30 port=ctx.args.port,
28 debug=ctx.args.debug) 31 debug=ctx.args.debug,
32 use_reloader=ctx.args.use_reloader)
29 server.run() 33 server.run()
30 34