4
votes

I'm using django-1.3 with django-staticfiles-1.2.1 and django-pipeline-1.2.6 This setup should work according to the documentation.

In the root of my project I have a directory staticfiles which contains a dir sass containing my sass files. I would like to see django-pipeline compile my sass files and put them in /static/css/master.css

Here's an extract of my settings.py file

MEDIA_ROOT = '/home/jonasg/dev/projectX/media/' 

STATIC_ROOT = 'static/'
STATIC_URL = '/static/'   
PIPELINE=True
PIPELINE_AUTO=True
STATICFILES_STORAGE = 'pipeline.storage.PipelineStorage'
STATICFILES_DIRS = ( 
    'staticfiles',
    )   
PIPELINE_COMPILERS = ( 
      'pipeline.compilers.sass.SASSCompiler',
      )   
PIPELINE_CSS_COMPRESSOR = 'pipeline.compressors.cssmin.CssminCompressor'

PIPLINE_CSS = { 
    'base': {
        'source_filenames': (
            'sass/*.sass'
            ),                                                                                                                                    
        'output_filename': 'css/master.css'
        }   
    }   
PIPELINE_COMPILERS = ( 
      'pipeline.compilers.sass.SASSCompiler',
      )   
PIPELINE_SASS_BINARY='/usr/bin/sass'
STATICFILES_FINDERS = ( 
         'staticfiles.finders.FileSystemFinder',
         'staticfiles.finders.AppDirectoriesFinder',
         'staticfiles.finders.DefaultStorageFinder'
      )   

When I run ./manage.py collectstatic, all files from /staticfiles are copied into /static but nothing is compiled or minified. Also I noticed that this commands takes all from /media and places them in /static , this is not a behavior I was expecting.

Also as you may have noticed above I'm using django-staticfiles, which is recommended by django-pipeline if you're still using django-1.3. I don't get why I should stick with django-staticfiles if this app has been migrated into django-1.3 ?

2
PIPLINE_CSS seems to be misspelled - Hersheezy

2 Answers

0
votes

The SASS compiler is expecting you sass file to have the extension .scss. It looks like SASS has added another extension/syntax, it will by fixed in the next version of pipeline.

Don't forget to change your staticfiles storage like this too :

STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage'
0
votes

I meet with the same issue, here's my fix, add

PIPELINE_STORAGE = 'pipeline.storage.PipelineCachedStorage'

in your settings. It works for me at least.