blob-upload-2_5.py 327 B

12345678910111213
  1. def _open(self, name, mode='rb'):
  2. """
  3. Return the AzureStorageFile.
  4. """
  5. from django.core.files.base import ContentFile
  6. contents = self._get_service().get_blob_to_bytes(
  7. container_name=self.container,
  8. blob_name=name
  9. )
  10. return ContentFile(contents)