Skip to content

Instantly share code, notes, and snippets.

@teehamaral
Created March 31, 2017 14:06
Show Gist options
  • Select an option

  • Save teehamaral/7610b773e6d727e38ba92d72fb19e41c to your computer and use it in GitHub Desktop.

Select an option

Save teehamaral/7610b773e6d727e38ba92d72fb19e41c to your computer and use it in GitHub Desktop.
import boto3
s3 = boto3.client('s3',
aws_access_key_id=settings.AWS_ACCESS_KEY_ID,
aws_secret_access_key=settings.AWS_SECRET_ACCESS_KEY
)
url = s3.generate_presigned_url(
'get_object',
Params={'Bucket': default_storage.bucket.name, 'Key': default_storage._encode_name(path)},
ExpiresIn=3600,
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment