示例#1
0
    def __init__(self):
        settings = dict(
            # __TODO:_GENERATE_YOUR_OWN_RANDOM_VALUE_HERE__
            # cookie_secret="bZJc2sWbQLKos6GkHn/VB9oXwQt8S0R0kRvJ5/xJ89E=",
            template_path=os.path.join(os.path.dirname(__file__), "templates"),
            static_path=os.path.join(os.path.dirname(__file__), "static"),
            xsrf_cookies=False,
            debug=options.debug,
            # login_url="/auth/api/unauthorized",
            # ssl_options={
            #    "certfile": os.path.join(os.path.abspath("."), "bike-forever.com.crt"),
            #    "keyfile": os.path.join(os.path.abspath("."), "bike-forever.com.key"),
            # }
        )

        handlers = router.map()

        super(Application, self).__init__(handlers, **settings)
示例#2
0
def main():

    # router_ajax放在列表前面,保证优先获取规则
    app = tornado.web.Application(
        router.map(),
        # __TODO:_GENERATE_YOUR_OWN_RANDOM_VALUE_HERE__
        cookie_secret="bZJc2sWbQLKos6GkHn/VB9oXwQt8S0R0kRvJ5/xJ89E=",
        template_path=os.path.join(os.path.dirname(__file__), "templates"),
        static_path=os.path.join(os.path.dirname(__file__), "static"),
        xsrf_cookies=False,
        debug=options.debug,
        login_url="/ops/auth/phone/login",
    )
    # tornado.locale.load_gettext_translations(os.path.join(os.path.dirname(__file__), "locale"), "aplan")
    tornado.locale.set_default_locale("en_US")
    tornado.options.parse_command_line()
    app.listen(options.port)
    tornado.ioloop.IOLoop.current().start()
示例#3
0
def main():

    # router_ajax放在列表前面,保证优先获取规则
    app = tornado.web.Application(
        router.map(),
        # __TODO:_GENERATE_YOUR_OWN_RANDOM_VALUE_HERE__
        cookie_secret="bZJc2sWbQLKos6GkHn/VB9oXwQt8S0R0kRvJ5/xJ89E=",
        template_path=os.path.join(os.path.dirname(__file__), "templates"),
        static_path=os.path.join(os.path.dirname(__file__), "static"),
        xsrf_cookies=False,
        debug=options.debug,
        login_url="/auth/login",
        ssl_options={
           "certfile": os.path.join(os.path.abspath("."), "7x24hs.com.crt"),
           "keyfile": os.path.join(os.path.abspath("."), "7x24hs.com.key"),
        }
    )
    # tornado.locale.load_gettext_translations(os.path.join(os.path.dirname(__file__), "locale"), "aplan")
    tornado.locale.set_default_locale("en_US")
    tornado.options.parse_command_line()
    app.listen(options.port)
    tornado.ioloop.IOLoop.current().start()
示例#4
0
def make_app():
    return swagger.Application(router.map(), autoreload=True,
        cookie_secret="bZJc2sWbQLKos6GkHn/VB9oXwQt8S0R0kRvJ5/xJ89E=")