]> git.ipfire.org Git - people/ms/webapp.git/commitdiff
Introduce new HomeHandler.
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 23 Nov 2009 12:14:00 +0000 (13:14 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 23 Nov 2009 12:14:00 +0000 (13:14 +0100)
application/__init__.py
application/handlers.py

index 8fb9dba75d4d6184aacb22b865da1410b691c05d..79e02a165604e8b06f9f2847efd12cd2f002244b 100644 (file)
@@ -7,7 +7,7 @@ import tornado.web
 BASEDIR = os.path.join(os.path.dirname(__file__), "..")
 
 from auth import LoginHandler, LogoutHandler
-from handlers import MainHandler
+from handlers import HomeHandler, MainHandler
 
 class Application(tornado.web.Application):
        def __init__(self):
@@ -22,6 +22,7 @@ class Application(tornado.web.Application):
 
                handlers = [
                        (r"/", MainHandler),
+                       (r"/home", HomeHandler),
                        (r"/login", LoginHandler),
                        (r"/logout", LogoutHandler),
                ] #self.get_handlers()
index 0c6a73c2d99357b3e872f6e38fb7aae0e82b1204..48f56fa5ee6708a7e30c0eb71cd2daad2dc3cb0c 100644 (file)
@@ -11,11 +11,16 @@ class BaseHandler(tornado.web.RequestHandler):
        def footer(self):
                return "%s" % socket.gethostname()
 
+
 class MainHandler(BaseHandler):
        def get(self):
                if not self.current_user:
                        self.redirect("/login")
                        return
+               self.redirect("/home")
+
 
+class HomeHandler(BaseHandler):
+       def get(self):
                self.render("template.html", title="Testsite", slogan="Security now!",
                        footer=self.footer(), user=self.current_user)