django-pipeline-1.1.27とs3botoを使用して静的ファイルを圧縮およびフィルタリングし、それらをs3バケットにアップロードしようとしています。私が使用する場合:
PIPELINE_STORAGE = 'pipeline.storage.PipelineFinderStorage'
それからそれは動作し、私が構成した素敵なバージョンのファイルを含む静的フォルダーを取得します。に切り替えるとすぐに
PIPELINE_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
私は得る
Traceback (most recent call last):
File "manage.py", line 15, in <module>
execute_manager(settings)
File "/my/virtual/env/lib/python2.7/site-packages/django/core/management/__init__.py", line 438, in execute_manager
utility.execute()
File "/my/virtual/env/lib/python2.7/site-packages/django/core/management/__init__.py", line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/my/virtual/env/lib/python2.7/site-packages/django/core/management/base.py", line 191, in run_from_argv
self.execute(*args, **options.__dict__)
File "/my/virtual/env/lib/python2.7/site-packages/django/core/management/base.py", line 220, in execute
output = self.handle(*args, **options)
File "/my/virtual/env/lib/python2.7/site-packages/pipeline/management/commands/synccompress.py", line 39, in handle
packager.pack_stylesheets(package, sync=sync, force=force)
File "/my/virtual/env/lib/python2.7/site-packages/pipeline/packager.py", line 52, in pack_stylesheets
**kwargs)
File "/my/virtual/env/lib/python2.7/site-packages/pipeline/packager.py", line 60, in pack
package['output'], package['paths'])
File "/my/virtual/env/lib/python2.7/site-packages/pipeline/versioning/__init__.py", line 45, in need_update
version = self.version(paths)
File "/my/virtual/env/lib/python2.7/site-packages/pipeline/versioning/__init__.py", line 20, in version
return getattr(self.versioner, 'version')(paths)
File "/my/virtual/env/lib/python2.7/site-packages/pipeline/versioning/hash/__init__.py", line 37, in version
buf = self.concatenate(paths)
File "/my/virtual/env/lib/python2.7/site-packages/pipeline/versioning/hash/__init__.py", line 27, in concatenate
return '\n'.join([self.read_file(path) for path in paths])
File "/my/virtual/env/lib/python2.7/site-packages/pipeline/versioning/hash/__init__.py", line 31, in read_file
file = storage.open(path, 'rb')
File "/my/virtual/env/lib/python2.7/site-packages/django/core/files/storage.py", line 33, in open
file = self._open(name, mode)
File "/my/virtual/env/lib/python2.7/site-packages/storages/backends/s3boto.py", line 177, in _open
raise IOError('File does not exist: %s' % name)
IOError: File does not exist: css/style.css
これは私のソースファイルの1つです。では、s3botoストレージに切り替えたときに、パイプラインがフィルター/連結/圧縮の手順を実行しなくなったのはなぜですか?
私が何かをしているのかもしれません。役立つ場合に備えて、他の構成を次に示します。
INSTALLED_APPS = (
...
'pipeline',
'storages',
)
STATICFILES_FINDERS = (
'pipeline.finders.PipelineFinder',
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
)
STATIC_ROOT = "/some/path/outside/django_project/deploy_static"
STATICFILES_DIRS = () # All statics in this site are in apps
STATICFILES_STORAGE = 'pipeline.storage.PipelineStorage'
PIPELINE_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
PIPELINE = True
PIPELINE_AUTO = True
PIPELINE_VERSION = True
PIPELINE_VERSION_PLACEHOLDER = 'VERSION'
PIPELINE_VERSIONING = 'pipeline.versioning.hash.SHA1Versioning'
PIPELINE_CSS = {
'standard': {
'source_filenames': (
'css/style.css',
...
),
'output_filename': 'css/all-VERSION.css',
'extra_context': {
'media': 'screen,projection',
},
}
}
私のサイトはDjango1.3.1にあります。
私が実行しているコマンドは次のとおりです。
python manage.py synccompress --force
AWS credsも設定に含まれていますが、その時点に到達していないため、それは意味がありません。
UPDATEコメントで要求されたフルスタックと設定を追加しました
更新ライブラリの作者の依頼で、最新のベータ版にアップグレードしてみました。これまでの観察:
- バージョン管理された圧縮ファイルを取得する方法がわかりません
- collectstaticは、圧縮ファイルとオリジナルを残します
- botoストレージが設定されている場合でもdjango-pipelineから同じエラーが発生します。ソースファイルをs3に送信したいのですが、アセットがステージングされている場所がわかりません。STATIC_ROOTには何も配置されません。
更新ファインダーストレージで機能し、S3Botoで動作する最も単純なプロジェクトを作成しました。私はそれをgithubにプッシュし、スタックトレースのキャプチャを含めました。
https://github.com/estebistec/simple_pipeline https://raw.github.com/estebistec/simple_pipeline/master/STACKTRACE
私が本当に馬鹿げたことをしていると言われることができれば、私は恍惚となるでしょう、そしてこれはすべてうまくいくはずです。