Skip to content

cachefile_storage accept callable which returns a storage object #525

@pickfire

Description

@pickfire

A storage object, or a callable which returns a storage object. This handles the storage and retrieval of your files. See Managing files for details on how to provide this object.

But imagekit only accepts a storage object. It should supports a callable which returns a storage object for feature parity with django.

So rather than doing cachefile_storage=S3Boto3Storage(), one can just do cachefile_storage=S3Boto3Storage.

storage = storage or getattr(generator, 'cachefile_storage',
None) or get_singleton(settings.IMAGEKIT_DEFAULT_FILE_STORAGE,
'file storage backend')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions