

def _upload_to_s3(key, file):
    key.set_contents_from_file(file, policy='public-read')
    cache_time = 0
    now = datetime.now()
    expire_dt = (now + timedelta(seconds=(cache_time * 1.5)))
    if (cache_time != 0):
        key.set_metadata('Cache-Control', ('max-age=%d, must-revalidate' % int(cache_time)))
        key.set_metadata('Expires', expire_dt.strftime('%a, %d %b %Y %H:%M:%S GMT'))
    key.make_public()

dataset/ETHPy150Open mtigas/django-medusa/django_medusa/renderers/s3.py _upload_to_s3/original