Skip to content

Shortcuts

get_s3_client()

Get s3 client based on Django default storage.

Source code in saritasa_s3_tools/django/shortcuts.py
 6
 7
 8
 9
10
11
def get_s3_client() -> client.S3Client:
    """Get s3 client based on Django default storage."""
    return client.S3Client(
        boto3_client=default_storage.connection.meta.client,  # type: ignore
        default_bucket=default_storage.bucket_name,  # type: ignore
    )