You need to sign in or sign up before continuing.
Commit c82371dc authored by Ilya Simonov's avatar Ilya Simonov

add log for upload file

parent 8d03a98e
import boto3
import logging
from django.conf import settings
log = logging.getLogger('send_video_to_s3')
def upload_file(content, key, content_type):
log.info(f'Uploading file {key} to S3...')
s3 = boto3.client(
's3',
aws_access_key_id=settings.AWS_ACCESS_KEY_ID,
......@@ -17,6 +23,7 @@ def upload_file(content, key, content_type):
Body=content,
ContentType=content_type,
)
log.info(f'File {key} uploaded to S3...')
return key
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment