2

I have a problem I can't solve. I have a sass template that easily compile with compass if I run it manually, but I cannot get the same result using django-pipeline.

My settings are simple. I have an assets dir to the common assets and a static dir for the deploy

STATIC_ROOT = os.path.join(BASE_DIR, 'static')
STATIC_URL = '/static/'

STATICFILES_DIRS = (
    ('assets', os.path.join(BASE_DIR, "assets")),
)

STATICFILES_STORAGE = 'pipeline.storage.PipelineStorage'

STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
    'pipeline.finders.PipelineFinder',
)

My Pipeline settings are simple just to make this work.

PIPELINE_CSS = {
    'public': {
        'source_filenames': (
               'assets/public/sass/scss/style.scss',
        ),
        'output_filename': 'css/style.css',
        'extra_context': {'media': 'all',},
    },
}

PIPELINE_JS = {
    'vendors': {
        'source_filenames': (
            # created using manage.py (check django-js-reverse)
            'assets/public/js/jquery/jquery-2.1.3.js',
            ....
        ),
        'output_filename': 'js/vendors.js',
    },
}

PIPELINE = {
    'PIPELINE_ENABLED': True,
    'STYLESHEETS': PIPELINE_CSS,
    'JAVASCRIPT': PIPELINE_JS,
    'SASS_BINARY': '/usr/bin/env compass',
    'SASS_ARGUMENS': '--trace',
    'JS_COMPRESSOR': None,
    'CSS_COMPRESSOR':  None,
    'DISABLE_WRAPPER': True,
    'COMPILERS': (
        'pipeline.compilers.sass.SASSCompiler',
    ),
}

The JS works, the js/vendors.js but the CSS give me an error:

pipeline.exceptions.CompilerError: ['/usr/bin/env', 'compass', u'/[..]application/static/assets/public/sass/scss/style.scss', u'/[..]application/static/assets/public/sass/scss/style.css'] exit code 1
Command not found: /[..]application/static/assets/public/sass/scss/style.scss

What I do not understand is why compass try the search in application/static/assets when I have BASE_DIR pointing to application and the STATICFILE_DIRS pointing correctly to assets. The JS works but not SASS. :-(

Any idea? I spent hours to figure out how to solve this.

Karim N Gorjux
  • 2,880
  • 22
  • 29

0 Answers0