Tornado Documentation
http://www.v2ex.com/tornado/
Tornado on GitHub
https://github.com/facebook/tornado/
Tornado Gists
http://tornadogists.org/
kenneth
V2EX  ›  Tornado

如何用写这样的url映射?

  •  
  •   kenneth · Oct 11, 2013 · 5063 views
    This topic created in 4674 days ago, the information mentioned may be changed or developed.
    static.xxx.com

    对应
    (r"/(.*)", tornado.web.StaticFileHandler, dict(path=settings['static_path'])),

    但是图片
    http://static.xxx.com/static/test.jpg 可以访问

    如何配置成
    http://static.xxx.com/test.jpg 因为我不想要static

    请问如何配置?
    2 replies    1970-01-01 08:00:00 +08:00
    BOYPT
        1
    BOYPT  
       Oct 11, 2013
    如果你做个专用的静态资源域名,就不要传给 tornado 来读静态资源了,直接在web前端比如nginx读取就是,这么做只能效率低。

    如果你一定要这么做(比如本地调试), 直接 ("/", tornado.web.StaticFileHandler, dict(path=settings['static_path'])),不就完了。
    est
        2
    est  
       Oct 11, 2013
    没有成本低的办法。根目录静态文件一直是大问题。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5125 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 41ms · UTC 09:36 · PVG 17:36 · LAX 02:36 · JFK 05:36
    ♥ Do have faith in what you're doing.