From bc1f4997f2480a992cbe3026b93407fc6ef36b44 Mon Sep 17 00:00:00 2001 From: Sheng Date: Tue, 27 Feb 2018 07:09:19 +0800 Subject: [PATCH] Added debug option --- main.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 579d606..18d8e47 100644 --- a/main.py +++ b/main.py @@ -16,6 +16,7 @@ from tornado.util import errno_from_exception define('address', default='127.0.0.1', help='listen address') define('port', default=8888, help='listen port', type=int) +define('debug', default=False, help='debug mode', type=bool) BUF_SIZE = 1024 @@ -264,8 +265,7 @@ def main(): 'template_path': os.path.join(base_dir, 'templates'), 'static_path': os.path.join(base_dir, 'static'), 'cookie_secret': uuid.uuid1().hex, - 'xsrf_cookies': True, - 'debug': True + 'xsrf_cookies': True } handlers = [ @@ -274,6 +274,7 @@ def main(): ] parse_command_line() + settings.update(debug=options.debug) app = tornado.web.Application(handlers, **settings) app.listen(options.port, options.address) logging.info('Listening on {}:{}'.format(options.address, options.port))