django-pipeline amazon S3生成空文件

时间:2015-02-15 16:58:36

标签: python django amazon-web-services amazon-s3

我正在尝试用amazon s3设置django-pipeline。我可以在我之前的项目中设置它,但我现在无法实现它,因为collectstatic在s3上生成空文件。

requirements.txt。

# S3
django-pipeline==1.4.6
django-storages-redux==1.2.2
boto==2.36

settings.py

STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
    'pipeline.finders.PipelineFinder',
)


PIPELINE_CSS = {
    'base': {
        'source_filenames': (
            'css/style.css',
        ),
        'output_filename': 'css/project_style.css',
        'extra_context': {
            'media': 'screen,projection',
        },
    },
}

PIPELINE_JS = {
    'base': {
        'source_filenames': (
            'js/libs/jquery.js',
            'js/libs/bootstrap.js',
            'js/libs/html5shiv.js',
            'js/base.js',
        ),
        'output_filename': 'js/core.js',
    }
}


STATICFILES_FINDERS = (
    'pipeline.finders.FileSystemFinder',
    'pipeline.finders.AppDirectoriesFinder',
    'pipeline.finders.CachedFileFinder',
    'pipeline.finders.PipelineFinder',
)

PIPELINE_ENABLED = True
PIPELINE_DISABLE_WRAPPER = True

PIPELINE_CSS_COMPRESSOR = 'pipeline.compressors.yuglify.YuglifyCompressor'
PIPELINE_JS_COMPRESSOR = 'pipeline.compressors.yuglify.YuglifyCompressor'

我也做了:

ln -s /usr/bin/nodejs /usr/bin/node
npm -g install yuglify

调用/ usr / bin / env yuglify正确调用yuglify

编辑:

我做了一个额外的调查并禁用了我的自定义存储空间并将其恢复为:

STATICFILES_STORAGE = 'pipeline.storage.PipelineStorage'

它没有帮助,因此压缩库可能存在问题。

0 个答案:

没有答案