0
Django static precompiler似乎没有为我工作scss
文件。我已经选中,如果我已经安装了编译器和我的Django的设置是如下Django静态预编译器不编译文件?
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'static_precompiler',
'cms',
]
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
'static_precompiler.finders.StaticPrecompilerFinder',
)
STATIC_URL = '/static/'
STATIC_ROOT = "static"
和我打电话从Django的模板相同如下
{% load compile_static %}
{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Spacemailer</title>
{% block seo %}
{% endblock %}
<link rel="stylesheet" href="{% static 'style/main.scss' | compile %}" type="text/css" media="all" />
</head>
<body>
{% block body %}
{% endblock %}
</body>
</html>
有没有任何错误。输出结果与scss
文件相同,没有进行编辑。有人能指出我在做什么错了吗?或者一些其他办法,支持编译scss
以及coffee
脚本
你有DEBUG设置为true ?有些预编译器在这种情况下不起作用,不知道这个tbh。 – marcinowski
我试着用'DEBUG'中的两个选项 – georoot