我曾经使用django-pipeline 1.2.6,它在查找静态文件时从来没有遇到过问题。升级后,它现在找不到静态文件在哪里。不知道出了什么问题,但我可能漏掉了什么。
我得到了这个错误:
ValueError: The file 'stylesheets/application.css.sass' could not be found with <pipeline.storage.PipelineFinderStorage object at 0x106e8b290>.我使用的是django 1.4。以下是我的设置:
path = lambda *a: os.path.join(ROOT_PATH, *a)
MEDIA_ROOT = ''
MEDIA_URL = ''
STATIC_ROOT = path('assets/')
STATIC_URL = 'assets/'
STATICFILES_DIRS = ()
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
)
INSTALLED_APPS = (
# ...
'django.contrib.staticfiles',
'pipeline',
'app',
)
STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage'
PIPELINE_COMPILERS = (
'pipeline.compilers.sass.SASSCompiler',
'pipeline.compilers.coffee.CoffeeScriptCompiler',
)
PIPELINE_CSS = {
'application': {
'source_filenames': (
'stylesheets/application.css.sass',
),
'output_filename': 'stylesheets/application.css',
},
}
PIPELINE_JS = {
'application': {
'source_filenames': (
'javascripts/application.js.coffee',
),
'output_filename': 'javascripts/application.js',
}
}请帮帮忙。
有趣的是:如果我完全删除PIPELINE_CSS,它也找不到javascripts/application.js.cafee。
另一件有趣的事情是,无论我使用哪个版本的django-pipeline,我都会得到以下结果:
$ python manage.py findstatic stylesheets/application.css.sass
No matching file found for 'stylesheets/application.css.sass'.我做错了什么?
发布于 2012-05-28 22:22:13
如果你有这个,不管你使用的是什么版本的管道:
$ python manage.py findstatic stylesheets/application.css.sass
No matching file found for 'stylesheets/application.css.sass'.这仅仅意味着django- should文件配置错误,一旦你弄清楚了,管道应该可以正常工作。
你的静态文件存储在哪里?在每个应用程序的static目录中,或者整个项目中,或者其他?
https://stackoverflow.com/questions/10758164
复制相似问题