Pra*_*dar 2 css python django minify django-compressor
我正在使用django-compressor来压缩css文件.
我按照http://django-compressor.readthedocs.org/en/latest/quickstart/中的解释做了.
我更改了我的模板文件,如下所示:
{% load staticfiles %}
{% load compress %}
<!DOCTYPE html>
<html lang="en">
<head>
{% compress css %}
<link href="{% static "crsq/css/zippednewsapp/bootstrap.readable.min.css" %}" rel="stylesheet">
<link href="{% static "crsq/css/zippednewsapp/zippednewsapp.css" %}" rel="stylesheet">
<link rel="stylesheet" href="{% static "crsq/css/zippednewsapp/typeahead.css" %}"/>
{% endcompress %}
</head>
.....
Run Code Online (Sandbox Code Playgroud)
我没有看到任何变化.没错.文件未压缩.我该如何改变?
在我的设置文件中:
DEBUG = False
TEMPLATE_DEBUG = False
STATIC_ROOT = ''
STATIC_URL = '/static/'
STATICFILES_DIRS = (
)
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
'compressor.finders.CompressorFinder',
)
Run Code Online (Sandbox Code Playgroud)
感谢任何帮助.谢谢
小智 5
如果html没有改变,我会在更改后检查服务器重启.
如果没有,您可以提高日志记录级别,并查看压缩机模块打印到日志中的内容.
此外,压缩器应在具有足够权限的用户下运行,以创建文件和文件夹COMPRESS_ROOT(默认为STATIC_ROOT)
问候
| 归档时间: |
|
| 查看次数: |
798 次 |
| 最近记录: |