您好我正在尝试使用 django-compressor 的预编译器将基础 scss 集成到 django 中,该项目如下所示:
├── manage.py
├── requirements.txt
├── static
│ ├── config.rb
│ ├── humans.txt
│ ├── index.html
│ ├── javascripts
│ │ ├── foundation
│ │ │ ├── foundation.alerts.js
│ │ │ ├── foundation.clearing.js
│ │ │ ├── foundation.cookie.js
│ │ │ ├── foundation.dropdown.js
│ │ │ ├── foundation.forms.js
│ │ │ ├── foundation.joyride.js
│ │ │ ├── foundation.js
│ │ │ ├── foundation.magellan.js
│ │ │ ├── foundation.orbit.js
│ │ │ ├── foundation.placeholder.js
│ │ │ ├── foundation.reveal.js
│ │ │ ├── foundation.section.js
│ │ │ ├── foundation.tooltips.js
│ │ │ └── foundation.topbar.js
│ │ └── vendor
│ │ ├── custom.modernizr.js
│ │ ├── jquery.js
│ │ └── zepto.js
│ ├── MIT-LICENSE.txt
│ ├── robots.txt
│ ├── sass
│ │ ├── app.scss
│ │ ├── normalize.scss
│ │ └── _settings.scss
│ └── stylesheets
│ ├── app.css
│ └── normalize.css
├── templates
│ ├── 404.html
│ ├── 500.html
│ ├── admin
│ │ └── base_site.html
│ └── base.html
└── weddings
├── __init__.py
├── __init__.pyc
├── local_settings.py
├── local_settings.pyc
├── settings.py
├── settings.pyc
├── urls.py
├── urls.pyc
└── wsgi.py
并且预编译器在 settings.py 中看起来像这样
COMPRESS_PRECOMPILERS = (
('text/x-scss', 'sass --scss --compass {infile} {outfile}'),
)
当我使用 nginx + uwsgi 运行它时,出现以下错误:
Syntax error: File to import not found or unreadable: foundation/foundation-global.
Load paths:
/etc/uwsgi/vassals
/etc/uwsgi/vassals/sass
/srv/www/weddings/gems/compass-0.12.2/frameworks/blueprint/stylesheets
/srv/www/weddings/gems/compass-0.12.2/frameworks/compass/stylesheets
Compass::SpriteImporter
/srv/www/weddings/gems/bourbon-3.1.1/app/assets/stylesheets
/srv/www/weddings/gems/bourbon-3.1.1/app/assets/stylesheets
on line 2 of /srv/www/weddings/weddings/static/sass/_settings.scss
from line 2 of /srv/www/weddings/weddings/static/sass/app.scss
Use --trace for backtrace.
我怀疑它没有读取 config.rb 或 config.rb 中的设置错误:
http_path = "/"
css_dir = "stylesheets"
sass_dir = "sass"
images_dir = "images"
javascripts_dir = "javascripts"