Skip to content

File Storage

from almasix.filesystem import Storage, storage
Storage.put("avatars/ada.png", contents)
Storage.disk("public").put("logo.svg", svg, visibility="public")
storage("local").get("avatars/ada.png")
Storage.url("avatars/ada.png")
Storage.exists("avatars/ada.png")

Config lives in config/filesystems.py. Default disks: local, public, s3 (optional almasix[s3] / boto3), plus memory for tests.

Terminal window
python smith storage:link

Creates public/storagestorage/app/public (configurable via filesystems.links).

temporary_url() is supported on S3-compatible disks (presigned). Local and memory disks raise RuntimeError — generate your own signed URLs if needed.

await Storage.disk("public").put_file_async("uploads", request.file("avatar"))
  • Cache — file cache under storage/framework/cache
  • Mail — attachments from Storage disks
  • Queues — job artifacts