web_test.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:deprecated_thedap 作者: unitedvote 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号