From: Michael Tremer Date: Wed, 19 Jan 2011 16:29:51 +0000 (+0100) Subject: Make debugging mode configureable at command line. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=18e6007992368faee1b108018b1bff3958081e32;p=ipfire.org.git Make debugging mode configureable at command line. --- diff --git a/www/webapp/__init__.py b/www/webapp/__init__.py index fb1bca7a..9dbb16fd 100644 --- a/www/webapp/__init__.py +++ b/www/webapp/__init__.py @@ -5,9 +5,10 @@ import os.path import simplejson import tornado.httpserver import tornado.locale -import tornado.options import tornado.web +from tornado.options import options + import backend from handlers import * @@ -21,7 +22,7 @@ class Application(tornado.web.Application): def __init__(self): settings = dict( cookie_secret = "aXBmaXJlY29va2llc2VjcmV0Cg==", - debug = True, + debug = options.debug, gzip = True, login_url = "/login", template_path = os.path.join(BASEDIR, "templates"), diff --git a/www/webapp/backend/__init__.py b/www/webapp/backend/__init__.py index 0ec8d57e..bad4e05b 100644 --- a/www/webapp/backend/__init__.py +++ b/www/webapp/backend/__init__.py @@ -1,7 +1,10 @@ #!/usr/bin/python -import tornado.options -tornado.options.parse_command_line() +from tornado.options import define, options, parse_command_line + +# Command line options +define("debug", default=False, help="Run in debug mode", type=bool) +parse_command_line() from accounts import Accounts from banners import Banners