module

SassCompile on command line

Following this StackOverflow reply,

/bin/sh: django_libsass.SassCompiler: command not found

Indicates that Django Compressor is trying to run django_libsass.SassCompiler as a shell command, and the script is failing to run. -Kevin Mooney

So digging through the traceback, I found a line that referenced compressor.

Further digging into compressor reveals this line in

/home/username/env/lib/python2.7/site-packages/compressor/filters/base.py

if "{outfile}" in self.command and not "outfile" in options:
ext = self.type and ".%s" % self.type or ""
self.outfile = NamedTemporaryFile(mode='r+', suffix=ext)
options["outfile"] = self.outfile.name
try:
command = fstr(self.command).format(**options)
proc = subprocess.Popen(command, shell=True, cwd=self.cwd,
stdout=self.stdout, stdin=self.stdin, stderr=self.stderr)
if self.infile is None:
filtered, err = proc.communicate(self.content.encode('utf8'))
else:
filtered, err = proc.communicate()
except (IOError, OSError), e:
raise FilterError('Unable to apply %s (%r): %s' %
(self.__class__.__name__, self.command, e))

So being the brutish non-coder that I am, I simply turned that ‘off’ to :

command = fstr(self.command).format(**options)
proc = subprocess.Popen(command, shell=False, cwd=self.cwd,
stdout=self.stdout, stdin=self.stdin, stderr=self.stderr)

It definitely helped to stop the

Error during template rendering

In template /home/username/env/lib/python2.7/site-packages/wagtail/wagtailadmin/templates/wagtailadmin/skeleton.html, error at line 20
/bin/sh: django_libsass.SassCompiler: command not found

Although now I get a :

'module' object has no attribute 'compile'

Hmm… let’s see where to go next?

Advertisements