gpt4 book ai didi

django-compressor:使用预编译器禁用缓存

转载 作者:行者123 更新时间:2023-12-01 22:54:54 29 4
gpt4 key购买 nike

我正在使用 django-compressor 来编译 scss 文件。
每次我修改 scss 文件时,django-compressor 都会在 /static/CACHE/css/123456.css 中构建一个 css 文件。

对于 pruduction 模式没问题,但是当我在本地开发时,我对所做的每项更改都会进行修订。

那么,在开发模式下,如何强制输出到同名文件?

这不是修订控制的问题......

COMPRESS_PRECOMPILERS = (
('text/x-sass', 'sass --compass "{infile}" "{outfile}"'),
('text/x-scss', 'sass --scss --compass "{infile}" "{outfile}"'),
)

最佳答案

缓存文件的文件名实际上基于其内容。来自 Django Compressor 文档:

Generating the combined file if needed

The file is generated if necessary. All precompilers are called and all filters are executed, and a hash is determined from the contents. This in turns helps determine the file name, which is only saved if it didn’t exist already. Then the HTML output is returned (and also saved in the cache). And that’s it!



http://django-compressor.readthedocs.org/en/latest/behind-the-scenes/#third-step-generating-the-combined-file-if-needed

我认为没有任何方法可以让 Django Compressor 使用指定的名称而不更改代码。

关于django-compressor:使用预编译器禁用缓存,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16830356/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com