Created
July 25, 2018 20:48
-
-
Save jordotech/4de71595bf8efd30287f8c2c3fa03713 to your computer and use it in GitHub Desktop.
use boto3 to upload to s3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
client = boto3.client( | |
's3', | |
aws_access_key_id = settings.AWS_ACCESS_KEY_ID, | |
aws_secret_access_key = settings.AWS_SECRET_ACCESS_KEY, | |
) | |
dst = 'media/temp_pdf/somefile.jpg' # This is the destination path inside the bucket | |
client.upload_file('/my/local/somefile.jpg', 'mybucketname', dst) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment