I've configured django-pipeline
as follows:
PIPELINE = {
'PIPELINE_ENABLED': True,
'COMPILERS': (
'pipeline.compilers.sass.SASSCompiler',
),
'STYLESHEETS': {
'common': {
'source_filenames': (
'sass/common/styles.scss',
),
'output_filename': 'css/common/styles.css',
}
}
}
I ran collectstatic
and started the server in debug mode to see if everything's set up properly. I can access all my images and scripts, but not the compiled CSS file. My static settings:
STATIC_ROOT = os.environ.get('DJANGO_STATIC_ROOT', os.path.join(BASE_DIR, '_static'))
STATIC_URL = '/static/'
STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage'
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
'pipeline.finders.PipelineFinder',
)
Some more observations:
- I added a breakpoint to
django.views.static.serve
and I noticed that it would trigger for http://127.0.0.1:8000/static/sass/, but not for http://127.0.0.1:8000/static/css/ or http://127.0.0.1:8000/static/css/common/styles.css. However, the compiled CSS file is present in_static/css/common/
(asstyles.css
andstyles.cba140b2c4b2.css
). - If I copy the contents of
_static/css/
into the originating app'sstatic
folder, the CSS renders normally. - Another possible symptom is that my templates aren't outputting versioned static file paths.
How can I make staticfiles
find the compiled CSS file?