推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
miniyao
V2EX  ›  Python

jinja2 有推荐的文件路径哈希的 webpack 库吗?

  •  1
     
  •   miniyao · Jan 3, 2018 via Android · 1922 views
    This topic created in 3141 days ago, the information mentioned may be changed or developed.
    文件下载的目录,把链接 hash 一下

    download/文件名.apk

    渲染成:

    download/zv4jsh8khqjbdjhiahbfk
    4 replies    2018-01-03 19:18:47 +08:00
    holajamc
        1
    holajamc  
       Jan 3, 2018   ❤️ 1
    不知道这个符不符合你的需求
    <script src="https://gist.github.com/jamcplusplus/9679a7a15b53262d8885b66ce16d39c1.js"></script>
    miniyao
        2
    miniyao  
    OP
       Jan 3, 2018
    @holajamc 貌似这个是直接真的把 文件名.apk 给硬 hash 了?

    我说的那个意思,其实服务器上还是 文件名.apk 这个形式,只是返回给用户的 url 时软 hash,并不真的改实际文件名。
    holajamc
        3
    holajamc  
       Jan 3, 2018
    @miniyao 这个只是在 jinja 中使用自定义过滤器完成你想要 url 哇,不会修改文件名的
    miniyao
        4
    miniyao  
    OP
       Jan 3, 2018 via Android
    @holajamc 误解了,我再看下下 😄😄😄
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3054 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 13:54 · PVG 21:54 · LAX 06:54 · JFK 09:54
    ♥ Do have faith in what you're doing.