123456789 |
- def upload(path, key):
- """Upload file to Amazon S3"""
- s3_client = boto3.resource(
- 's3',
- aws_access_key_id=CONFIG['aws']['s3']['access-key'],
- aws_secret_access_key=CONFIG['aws']['s3']['secret-access-key']
- )
- s3_client.meta.client.upload_file(path, CONFIG['aws']['s3']['bucket'],
- time.strftime("%Y/%m/%d/") + key)
|