我正在尝试使 django-pipeline 工作,但它不起作用。下面是我的看法。我在应用程序部分添加了“管道”。
这是我尝试打开网站时出现的错误: “设置”对象没有属性“管道”
以下是我的设置:
STATIC_URL = '/static/'
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'static'),
]
STATIC_ROOT = os.path.join(BASE_DIR, 'static_cdn')
STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage'
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
'pipeline.finders.PipelineFinder',
)
PIPELINE_JS = {
'stats': {
'source_filenames': (
'js/base.js',
),
'output_filename': 'site-js-min.js',
}
}
PIPELINE_CSS = {
'colors': {
'source_filenames': (
'css/base.css',
),
'output_filename': 'site-css-min.css',
'variant': 'datauri',
'extra_context': {
'media': 'screen,projection',
}
}
}