4

我已经配置django-pipeline如下:

PIPELINE = {
    'PIPELINE_ENABLED': True,
    'COMPILERS': (
        'pipeline.compilers.sass.SASSCompiler',
    ),
    'STYLESHEETS': {
        'common': {
            'source_filenames': (
                'sass/common/styles.scss',
            ),
            'output_filename': 'css/common/styles.css',
        }
    }
}

collectstatic在调试模式下运行并启动了服务器,以查看一切是否设置正确。我可以访问我所有的图像和脚本,但不能访问已编译的 CSS 文件。我的静态设置:

STATIC_ROOT = os.environ.get('DJANGO_STATIC_ROOT', os.path.join(BASE_DIR, '_static'))
STATIC_URL = '/static/'
STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage'
STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
    'pipeline.finders.PipelineFinder',
)

更多观察:

我怎样才能staticfiles找到编译好的 CSS 文件?

4

0 回答 0