def get_app(self):
class MyStaticFileHandler(StaticFileHandler):
def get(self, path):
assert path == "foo.txt"
self.write("bar")
@classmethod
def make_static_url(cls, settings, path):
return "/static/%s?v=42" % path
class StaticUrlHandler(RequestHandler):
def get(self, path):
self.write(self.static_url(path))
return Application([("/static_url/(.*)", StaticUrlHandler)],
static_path="dummy",
static_handler_class=MyStaticFileHandler)
评论列表
文章目录