]> git.ipfire.org Git - ipfire.org.git/commitdiff
Make debugging mode configureable at command line.
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 19 Jan 2011 16:29:51 +0000 (17:29 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 19 Jan 2011 16:29:51 +0000 (17:29 +0100)
www/webapp/__init__.py
www/webapp/backend/__init__.py

index fb1bca7aa7a2476fd3afb4551d65886f6d106df1..9dbb16fdf301071004da4df83e6856731d46471e 100644 (file)
@@ -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"),
index 0ec8d57e3d7336df421090efd30456c1448aa0c7..bad4e05bc9cf7e1cc26c4299e06772a7db992e7f 100644 (file)
@@ -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