Skip to main content

Multiple object storage backends for Django (MinIO, Backblaze B2, and more)

Project description

Django Storage

Supported backends

  • MinIO
  • Backblaze B2

Installation

pip install django-storage

Usage

BackBlazeB2

Reads configuration from Django settings when not provided explicitly:

# For Django 4.2+

STORAGE_B2_APP_KEY = ""
STORAGE_B2_ACCOUNT_ID = ""
STORAGE_B2_BUCKET_NAME = ""
STORAGE_B2_BUCKET_ID = ""

STORAGES = {
    "default": {
        "BACKEND": "django_object_storage.b2.B2Storage",
    },
}

# Or for Django 4.2+ with options
STORAGES = {
    "default": {
        "BACKEND": "django_object_storage.b2.B2Storage",
        "OPTIONS": {
            "account_id": "",
            "app_key": "",
            "bucket_name": "",
            "bucket_id": "",
        },
    },
}

# For Django versions below 4.2
DEFAULT_FILE_STORAGE = "django_object_storage.b2.B2Storage"

MinIO

Reads configuration from Django settings when not provided explicitly:

# For Django 4.2+

STORAGE_MINIO_BUCKET_NAME = ""
STORAGE_MINIO_ENDPOINT = "" # s3.example.com
STORAGE_MINIO_ACCESS_KEY = ""
STORAGE_MINIO_SECRET_KEY = ""
STORAGE_MINIO_SECURE = True  # True or False

STORAGES = {
    "default": {
        "BACKEND": "django_object_storage.minio.MinIOStorage",
    },
}

# Or for Django 4.2+ with options
STORAGES = {
    "default": {
        "BACKEND": "django_object_storage.minio.MinIOStorage",
        "OPTIONS": {
            "bucket_name": "",
            "endpoint": "", # s3.example.com
            "access_key": "",
            "secret_key": "",
            "secure": True,  # True or False
        },
    },
}

# For Django versions below 4.2
DEFAULT_FILE_STORAGE = "django_object_storage.minio.MinIOStorage"

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_object_storage-0.1.0.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_object_storage-0.1.0-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file django_object_storage-0.1.0.tar.gz.

File metadata

  • Download URL: django_object_storage-0.1.0.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.23

File hashes

Hashes for django_object_storage-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2a827f66fedeb5906ebd5973c1aa82a1519eeb6aaa5157cac8c663af728a568f
MD5 e6ca3a47675873f1ce92f021d2c3dd3e
BLAKE2b-256 46203df18ad0cc5d7ab98fbe295e8126e2f7d85ea1d504993f5af96fb26f9271

See more details on using hashes here.

File details

Details for the file django_object_storage-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_object_storage-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9bfdfbc9fecd13320c2dd9ac6899ea4cede6ef94f68c7392b98532c8b8126d3d
MD5 884d7330f2092600641b4c63441561b4
BLAKE2b-256 0bd89ed69edf8f454c93f5e88aed976147e019441344055a0b64ac7eb8245162

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page