【发布时间】:2016-10-23 16:24:51
【问题描述】:
我一直在努力让 Django 识别我的 SCSS 文件(我可能误用了 SCSS/SASS/LESS 术语......他们的关系让我感到困惑)。我正在使用django-libsass 和compress,它们看起来都非常简单。我的页面给了我错误“资源解释为样式表,但使用 MIME 类型应用程序/八位字节流传输:”。它正在加载页面,但我的样式都没有显示。
我不确定人们需要看到什么。我的模板包括:
<link href="{% static 'css/blog.scss' %}" rel="stylesheet">
(当它是 css 时它工作得很好)
设置:
COMPRESS_PRECOMPILERS = (
('text/x-scss', 'django_libsass.SassCompiler'),
)
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
# other finders..
'compressor.finders.CompressorFinder',
)
【问题讨论】: