Reputation: 83
I've installed django-pipeline on my Django 1.4.1 application under a virtualenv but when I run python manage.py collectstatic
, I get:
Traceback (most recent call last):
File "./manage.py", line 11, in <module>
execute_manager(settings)
File "/home/hg/VIRTUALENVS/movie/lib/python2.6/site-packages/django/core/management/__init__.py", line 459, in execute_manager
utility.execute()
File "/home/hg/VIRTUALENVS/movie/lib/python2.6/site-packages/django/core/management/__init__.py", line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/hg/VIRTUALENVS/movie/lib/python2.6/site-packages/django/core/management/base.py", line 196, in run_from_argv
self.execute(*args, **options.__dict__)
File "/home/hg/VIRTUALENVS/movie/lib/python2.6/site-packages/django/core/management/base.py", line 232, in execute
output = self.handle(*args, **options)
File "/home/hg/VIRTUALENVS/movie/lib/python2.6/site-packages/django/core/management/base.py", line 371, in handle
return self.handle_noargs(**options)
File "/home/hg/VIRTUALENVS/movie/lib/python2.6/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 163, in handle_noargs
collected = self.collect()
File "/home/hg/VIRTUALENVS/movie/lib/python2.6/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 119, in collect
dry_run=self.dry_run)
File "/home/hg/VIRTUALENVS/movie/lib/python2.6/site-packages/pipeline/storage.py", line 30, in post_process
packager.pack_stylesheets(package)
File "/home/hg/VIRTUALENVS/movie/lib/python2.6/site-packages/pipeline/packager.py", line 90, in pack_stylesheets
variant=package.variant, **kwargs)
File "/home/hg/VIRTUALENVS/movie/lib/python2.6/site-packages/pipeline/packager.py", line 100, in pack
content = compress(paths, **kwargs)
File "/home/hg/VIRTUALENVS/movie/lib/python2.6/site-packages/pipeline/compressors/__init__.py", line 76, in compress_css
css = getattr(compressor(verbose=self.verbose), 'compress_css')(css)
File "/home/hg/VIRTUALENVS/movie/lib/python2.6/site-packages/pipeline/compressors/yui.py", line 14, in compress_css
return self.compress_common(css, 'css', settings.PIPELINE_YUI_CSS_ARGUMENTS)
File "/home/hg/VIRTUALENVS/movie/lib/python2.6/site-packages/pipeline/compressors/yui.py", line 8, in compress_common
return self.execute_command(command, content)
File "/home/hg/VIRTUALENVS/movie/lib/python2.6/site-packages/pipeline/compressors/__init__.py", line 235, in execute_command
pipe.stdin.write(smart_str(content))
IOError: [Errno 32] Broken pipe
My settings are:
# static
STATIC_ROOT = join(REPOSITORY_ROOT, 'static_collected')
STATIC_URL = '/static/'
STATICFILES_DIRS = (join(REPOSITORY_ROOT, 'static'),)
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
)
# pipeline (css/js compression)
STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage'
PIPELINE = True
PIPELINE_CSS = {
'base_style': {
'source_filenames': (
'css/style.css',
'css/effects.css',
'css/rs_style.css',
'css/jq/jquery-ui-movieplayer.css',
),
'output_filename': 'CACHE/css/style.css',
},
}
PIPELINE_JS = {
'base_scripts': {
'source_filenames': (
'js/jq/jquery.js',
'js/mv.core.js',
'js/toolbox/toolbox.core.js',
'js/swfobject.js',
'swf/jwplayer5.9.2156.js',
'js/jq/jquery-ui.custom.min.js',
'js/mongo_autocomplete.js',
'js/rs_script.js',
),
'output_filename': 'CACHE/js/scripts.js',
}
}
Before adding django-pipeline the management command worked well, it found everything, so it's not an issue related to finding the static files nor to directory permissions.
The Yuicompressor is installed globally and can be found under /usr/local/bin/yuicompressor
so I didn't modify PIPELINE_YUI_BINARY
in my settings.
Any clue? Thank you!
Upvotes: 2
Views: 3187
Reputation: 5597
IOError: [Errno 32] Broken pipe
This error means that yuicompressor
has quit before we had time to send data (most of the time because it crashed or because it wasn't found). Check your yuicompressor
path, and check if yuicompressor
actually works.
Upvotes: 2
Reputation: 1
Add paths to the executables in the setting, e.g.
PIPELINE_YUI_BINARY = '/usr/bin/yui-compressor'
PIPELINE_LESS_BINARY = '/usr/local/lib/node_modules/less/bin/lessc'
Paths may differ(especially for lessc, in this example less was installed with "npm install -g less")
Upvotes: 0