Skip to content

Instantly share code, notes, and snippets.

@goloveychuk
Created May 21, 2015 15:55
Show Gist options
  • Save goloveychuk/a1fee22d1d4b38b6057f to your computer and use it in GitHub Desktop.
Save goloveychuk/a1fee22d1d4b38b6057f to your computer and use it in GitHub Desktop.
s3.py
import boto
import boto.s3.connectionDELAY = 1
conn = boto.connect_s3(
aws_access_key_id=settings.AWS_ACCESS_KEY_ID,
aws_secret_access_key=settings.AWS_SECRET_ACCESS_KEY,
calling_format=boto.s3.connection.OrdinaryCallingFormat(),
)
bucket = conn.create_bucket(settings.BUCKET_NAME)
key = bucket.new_key(image_key)
key.set_contents_from_string(resp.content)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment