Exemplo n.º 1
0
    def __init__(self):
        settings = {
            "cookie_secret": "27yc1u%9tt3$o^$3uu=6e(=2d7mykjd8@dc*#x0z%vm&0_vdq",
            "debug": True,  # debug mode not compatible with multiprocessing environment.
            "gzip": False,
            "static_path": os.path.join(os.path.dirname(__file__), "static"),
            "js": os.path.join(os.path.dirname(__file__), "js"),
            "css": os.path.join(os.path.dirname(__file__), "css"),
            "img": os.path.join(os.path.dirname(__file__), "img"),
            "template_path": os.path.join(os.path.dirname(__file__), "templates"),
        }

        handlers = [
            (r"^/$", MainHandler),
            (r"^/login/$", LoginHandler),
            (r"^/logout/$", LogoutHandler),
            (r"^/static/(.*)", web.StaticFileHandler, dict(path=settings["static_path"])),
            (r"^/css/(.*)", web.StaticFileHandler, dict(path=settings["css"])),
            (r"^/js/(.*)", web.StaticFileHandler, dict(path=settings["js"])),
            (r"^/img/(.*)", web.StaticFileHandler, dict(path=settings["img"])),
        ]

        apps = load_url_handlers()
        handlers.extend(apps)
        # custom http error handler
        handlers.append((r"/.*", PageNotFound))
        web.Application.__init__(self, handlers, **settings)
Exemplo n.º 2
0
 def __init__(self):
     settings = {
     "cookie_secret": "27yc1u%9tt3$o^$3uu=6e(=2d7mykjd8@dc*#x0z%vm&0_vdq",
     "debug": True,   # debug mode not compatible with multiprocessing environment.
     "gzip": False,
     'static_path': os.path.join(os.path.dirname(__file__), "static"),
     'js': os.path.join(os.path.dirname(__file__), "js"),
     'css': os.path.join(os.path.dirname(__file__), "css"),
     'img': os.path.join(os.path.dirname(__file__), "img"),
     'template_path': os.path.join(os.path.dirname(__file__), "templates"),
     }
 
     handlers = [
         (r"^/$", MainHandler),
         (r"^/getdata/$", DataHandler),
         (r"^/save_position/$", PositionHandler),
         (r"^/node_config/$", NodeConfigHandler),
         (r"^/wizcloud_capacity/$", WizCloudCapacityHandler),
         (r"^/perf_rank/([^/]+)/$", PerfRankHandler),
         (r"^/top_alerts/([^/]+)/$", TopAlertsHandler),
         (r"^/login/$", LoginHandler),
         (r"^/logout/$", LogoutHandler),
         (r"^/static/(.*)", web.StaticFileHandler, dict(path=settings['static_path'])),
         (r"^/css/(.*)", web.StaticFileHandler, dict(path=settings['css'])),
         (r"^/js/(.*)", web.StaticFileHandler, dict(path=settings['js'])),
         (r"^/img/(.*)", web.StaticFileHandler, dict(path=settings['img'])),
     ]
     
     apps = load_url_handlers()
     handlers.extend(apps)
     # custom http error handler
     handlers.append((r"/.*", PageNotFound))
     web.Application.__init__(self, handlers, **settings)
Exemplo n.º 3
0
    def __init__(self):
        settings = {
            "cookie_secret":
            "27yc1u%9tt3$o^$3uu=6e(=2d7mykjd8@dc*#x0z%vm&0_vdq",
            "debug":
            True,  # debug mode not compatible with multiprocessing environment.
            "gzip": False,
            'static_path': os.path.join(os.path.dirname(__file__), "static"),
            'js': os.path.join(os.path.dirname(__file__), "js"),
            'css': os.path.join(os.path.dirname(__file__), "css"),
            'img': os.path.join(os.path.dirname(__file__), "img"),
            'template_path': os.path.join(os.path.dirname(__file__),
                                          "templates"),
        }

        handlers = [
            (r"^/$", MainHandler),
            (r"^/getdata/$", DataHandler),
            (r"^/save_position/$", PositionHandler),
            (r"^/node_config/$", NodeConfigHandler),
            (r"^/wizcloud_capacity/$", WizCloudCapacityHandler),
            (r"^/perf_rank/([^/]+)/$", PerfRankHandler),
            (r"^/top_alerts/([^/]+)/$", TopAlertsHandler),
            (r"^/login/$", LoginHandler),
            (r"^/logout/$", LogoutHandler),
            (r"^/static/(.*)", web.StaticFileHandler,
             dict(path=settings['static_path'])),
            (r"^/css/(.*)", web.StaticFileHandler, dict(path=settings['css'])),
            (r"^/js/(.*)", web.StaticFileHandler, dict(path=settings['js'])),
            (r"^/img/(.*)", web.StaticFileHandler, dict(path=settings['img'])),
        ]

        apps = load_url_handlers()
        handlers.extend(apps)
        # custom http error handler
        handlers.append((r"/.*", PageNotFound))
        web.Application.__init__(self, handlers, **settings)
Exemplo n.º 4
0
    def __init__(self):
        settings = {
            'static_path': os.path.join(os.path.dirname(__file__), "static"),
            'js': os.path.join(os.path.dirname(__file__), "js"),
            'css': os.path.join(os.path.dirname(__file__), "css"),
            'img': os.path.join(os.path.dirname(__file__), "img"),
            'template_path': os.path.join(os.path.dirname(__file__),
                                          "templates"),
        }

        handlers = [
            # (r"^/$", MainHandler),
            (r"^/static/(.*)", web.StaticFileHandler,
             dict(path=settings['static_path'])),
            (r"^/css/(.*)", web.StaticFileHandler, dict(path=settings['css'])),
            (r"^/js/(.*)", web.StaticFileHandler, dict(path=settings['js'])),
            (r"^/img/(.*)", web.StaticFileHandler, dict(path=settings['img'])),
        ]

        apps = load_url_handlers()
        handlers.extend(apps)
        # custom http error handler
        handlers.append((r"/.*", PageNotFound))
        web.Application.__init__(self, handlers, **settings)