Exemplo n.º 1
0
    def get(self):
        refresh = int(self.get_argument('refresh', 0))

        if refresh == 1:
            vote_model.cahe_accounts()
            self.write("部署成功")
        else:
            self.render("admin/reload-cache.html")
Exemplo n.º 2
0
def main():
    parse_command_line()

    init_db()           # 初始化数据库
    cahe_accounts()     # 缓存账户数据到内存

    http_server = tornado.httpserver.HTTPServer(application)
    http_server.listen(options.port)
    print 'Server is running at http://127.0.0.1:%s/' % options.port
    print 'Quit the server with Control-C'
    tornado.ioloop.IOLoop.instance().start()
Exemplo n.º 3
0
def main():
    parse_command_line()

    init_db()  # 初始化数据库
    cahe_accounts()  # 缓存账户数据到内存

    http_server = tornado.httpserver.HTTPServer(application)
    http_server.listen(options.port)
    print 'Server is running at http://127.0.0.1:%s/' % options.port
    print 'Quit the server with Control-C'
    tornado.ioloop.IOLoop.instance().start()