Skip to content

Instantly share code, notes, and snippets.

@ugnb
ugnb / boto3_digitalocean.py
Last active November 24, 2023 16:52
Using Python boto3 with DigitalOcean object storage
import logging
import urllib.request
import boto3
from settings import OBJECT_STORAGE_KEY, OBJECT_STORAGE_SECRET, OBJECT_STORAGE_REGION, OBJECT_STORAGE_BUCKET
logger = logging.getLogger(__name__)
s3config = {
"region_name": OBJECT_STORAGE_REGION,
"endpoint_url": "https://{}.digitaloceanspaces.com".format(OBJECT_STORAGE_REGION),