.less
を使用していくつかのファイルをコンパイルしようとしていますdjango-pipeline
。を実行するcollectstatic
と、すべてが正しくコピーされますが、次のエラーが発生します。
Traceback (most recent call last):
File "manage.py", line 35, in <module>
execute_manager(settings)
File ".../lib/python2.7/site-packages/django/core/management/__init__.py", line 459, in execute_manager
utility.execute()
File ".../lib/python2.7/site-packages/django/core/management/__init__.py", line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File ".../lib/python2.7/site-packages/django/core/management/base.py", line 196, in run_from_argv
self.execute(*args, **options.__dict__)
File ".../lib/python2.7/site-packages/django/core/management/base.py", line 232, in execute
output = self.handle(*args, **options)
File ".../lib/python2.7/site-packages/django/core/management/base.py", line 371, in handle
return self.handle_noargs(**options)
File ".../lib/python2.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 163, in handle_noargs
collected = self.collect()
File ".../lib/python2.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 119, in collect
dry_run=self.dry_run)
File ".../lib/python2.7/site-packages/pipeline/storage.py", line 26, in post_process
output_file = packager.pack_stylesheets(package)
File ".../lib/python2.7/site-packages/pipeline/packager.py", line 90, in pack_stylesheets
variant=package.variant, **kwargs)
File ".../lib/python2.7/site-packages/pipeline/packager.py", line 99, in pack
paths = self.compile(package.paths)
File ".../lib/python2.7/site-packages/pipeline/packager.py", line 93, in compile
return self.compiler.compile(paths)
File ".../lib/python2.7/site-packages/pipeline/compilers/__init__.py", line 34, in compile
compiled_content = compiler.compile_file(content, finders.find(path))
File ".../lib/python2.7/site-packages/pipeline/compilers/less.py", line 19, in compile_file
cwd = os.path.dirname(path)
File ".../lib64/python2.7/posixpath.py", line 120, in dirname
i = p.rfind('/') + 1
AttributeError: 'NoneType' object has no attribute 'rfind'
の型で奇妙なことをしたとは思いませんが、念settings.py
のために関連する部分を次に示します。
STATICFILES_STORAGE = "pipeline.storage.PipelineCachedStorage"
PIPELINE = True
STATICFILES_DIRS = (
("projectname", os.path.join(REPO_ROOT, "static")),
)
PIPELINE_COMPILERS = (
'pipeline.compilers.coffee.CoffeeScriptCompiler',
'pipeline.compilers.less.LessCompiler'
)
PIPELINE_JS = {
'projectname': {
'source_filenames': ('js/*.coffee',),
'output_filename': 'projectname/js.js'
}
}
PIPELINE_CSS = {
'projectname': {
'source_filenames': ('css/style.less',),
'output_filename': 'projectname/css.css'
}
}
CSSsource_filenames
をグロブ (つまりcss/*.less
) に置き換えると、同じ結果が得られます。ファイルは間違いなく私が言っている場所です(少なくとも、間違っていることがわかっているパスに置き換えると、別のエラーが発生します)。PIPELINE_CSS
行をコメントアウトすると、CoffeeScript は問題なく JS にコンパイルされます。何か案は?