django-bakery icon indicating copy to clipboard operation
django-bakery copied to clipboard

Integration with django-storages (AWS S3)

Open monkut opened this issue 5 years ago • 0 comments

I use a non-standard configuration of django/zappa/django-storages to serve django apps from aws lambda and s3.

I'm currently trying to use django-bakery in combination with wagtail to generate static sites which are then sync'd to an s3 bucket to serve.

Currently the django-bakery build command appears to assume that everything is on the local file system.

However, when django-storages is used build command files with:

  File "/home/.../gTxZnR9B/lib/python3.8/site-packages/bakery/management/commands/build.py", line 105, in handle
    self.build_static()
  File "/home/.../gTxZnR9B/lib/python3.8/site-packages/bakery/management/commands/build.py", line 196, in build_static
    copy.copy_dir("osfs:///", self.static_root, self.fs, target_dir)
  File "/home/.../gTxZnR9B/lib/python3.8/site-packages/fs/copy.py", line 292, in copy_dir
    _dst_fs.makedir(_dst_path, recreate=True)
  File "/home/.../gTxZnR9B/lib/python3.8/site-packages/fs/osfs.py", line 340, in makedir
    raise errors.ResourceNotFound(path)
fs.errors.ResourceNotFound: resource '/tmp/build/{AWS S3 BUCKET PATH}' not found

monkut avatar Jul 22 '20 01:07 monkut