def __init__(self): handlers=HANDLERS + Route.routes() settings = { "static_path": STATIC_PATH , "template_path": TEMPLATE_PATH, "login_url": "/login/", "debug": True, "cookie_secret": "61oETzKXQAGaYdkL5gEmGeJJFuYh7EQnp2XdTP1o/Vo=", #"xsrf_cookies":True, } tornado.web.Application.__init__(self, handlers, **settings)
def __init__(self): self.jinja_env = jinja_environment self.jinja_env.filters.update(register_filters()) self.jinja_env.tests.update({}) self.jinja_env.globals['settings'] = settings self.memcachedb = memcachedb self.session_store = MemcacheSessionStore(memcachedb) handlers = [ tornado.web.url(r"/style/(.+)", tornado.web.StaticFileHandler, dict(path=settings['static_path']), name='static_path'), tornado.web.url(r"/upload/(.+)", tornado.web.StaticFileHandler, dict(path=settings['upload_path']), name='upload_path') ] + Route.routes() tornado.web.Application.__init__(self, handlers, **settings)
def __init__(self): self.jinja_env = jinja_environment self.jinja_env.filters.update(register_filters()) self.jinja_env.tests.update({}) self.jinja_env.globals['settings'] = settings handlers = [ tornado.web.url(r"/style/(.+)", tornado.web.StaticFileHandler, dict(path=settings['static_path']), name='static_path'), tornado.web.url(r"/upload/(.+)", tornado.web.StaticFileHandler, dict(path=settings['upload_path']), name='upload_path') ] + Route.routes() self.session_manager = session.SessionManager(settings["session_secret"], settings, settings["session_timeout"]) tornado.web.Application.__init__(self, handlers, **settings)
def __init__(self): settings.update({"xsrf_cookies": False}) self.jinja_env = jinja_environment self.jinja_env.filters.update(register_filters()) self.jinja_env.tests.update({}) self.jinja_env.globals['settings'] = settings self.memcachedb = memcachedb handlers = [tornado.web.url(r"/upload/(.+)", tornado.web.StaticFileHandler, \ dict(path=settings['upload_path']), name='upload_path'), \ tornado.web.url(r"/style/(.+)", tornado.web.StaticFileHandler, \ dict(path=settings['static_path']), name='static_path')] + \ Route.routes() + [(r".*", MobilePageNotFoundHandler)] tornado.web.Application.__init__(self, handlers, **settings)
def __init__(self): self.memcachedb = memcachedb self.session_store = MemcacheSessionStore(memcachedb) self.frameworkcache_store = MemcacheFrameworkCacheStore(memcachedb) handlers = [ tornado.web.url(r"/static/(.+)", tornado.web.StaticFileHandler, dict(path=settings['static_path']), name='static_path'), tornado.web.url(r"/upload/(.+)", tornado.web.StaticFileHandler, dict(path=settings['upload_path']), name='upload_path') ] + Route.routes() tornado.web.Application.__init__(self, handlers, **settings)
def __init__(self,settings): bcc = None self.memcachedb = memcache.Client([settings['memcache_host']]) self.session_store = MemcacheSessionStore(self.memcachedb) if settings['debug'] == False: bcc = MemcachedBytecodeCache(self.memcachedb) self.jinja_env = Environment( loader = FileSystemLoader(settings['template_path']), bytecode_cache = bcc, auto_reload = settings['debug'], autoescape = False) self.jinja_env.filters.update(register_filters()) self.jinja_env.tests.update({}) self.jinja_env.globals['settings'] = settings handlers = [ tornado.web.url(r"/style/(.+)", tornado.web.StaticFileHandler, dict(path=settings['static_path']), name='static_path'), tornado.web.url(r"/upload/(.+)", tornado.web.StaticFileHandler, dict(path=settings['upload_path']), name='upload_path') ] + Route.routes() #print settings['debug'] tornado.web.Application.__init__(self, handlers, **settings)
def main(self): Env.setFromFile('config/env.json') r = Route() return r.main()