Skip to main content

Django Cloud Storage

Django Cloud Storage is a Python package that provides a custom storage backend designed for seamless integration with proprietary cloud storage service.

Installation

pip install django-cloud-storage

Configuration

In your Django settings file, set the following values:

CLOUD_STORAGE_URL = 'https://your-cloud-service.com'
CLOUD_STORAGE_API_TOKEN = 'your-api-token'
CLOUD_STORAGE_PROJECT_ALIAS = 'myproject'

Optional settings

Setting Default Description
CLOUD_STORAGE_VERIFY True TLS verification, passed to Requests: use False only for local development with self-signed certificates, or a string path to a CA bundle for private CAs.
CLOUD_STORAGE_TIMEOUT 30 Request timeout in seconds (or a (connect, read) tuple as supported by Requests).

The client reuses HTTP connections via a requests.Session, and opening a file for reading ('rb' / 'r') performs a single download instead of a separate existence check followed by a read.

Security: Setting CLOUD_STORAGE_VERIFY = False disables certificate validation and exposes you to man-in-the-middle attacks. Prefer installing your CA or pointing CLOUD_STORAGE_VERIFY at a PEM bundle when using internal certificate authorities.

# Example: internal CA (recommended over verify=False)
CLOUD_STORAGE_VERIFY = '/etc/ssl/certs/my-org-ca.pem'

# Example: local dev only (insecure)
CLOUD_STORAGE_VERIFY = False

Usage

To integrate the Cloud Storage with a Django model, follow these steps:

  • Import the required models and CloudStorage:

    from django_cloud_storage.storage import CloudStorage
    
  • Define your Django model, using CloudStorage as the storage backend for a FileField:

    class MyModel(models.Model):
        file_field = models.FileField(storage=CloudStorage)
    
        def __str__(self):
            return self.file_field.name
    

Download files

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

Source Distribution

django_cloud_storage-1.0.7.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

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

django_cloud_storage-1.0.7-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file django_cloud_storage-1.0.7.tar.gz.

File metadata

  • Download URL: django_cloud_storage-1.0.7.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for django_cloud_storage-1.0.7.tar.gz
Algorithm Hash digest
SHA256 39017b19c5a524b25f389e52d39756e190d5de8ca93b95a6a45e121da37e6850
MD5 d1f3e3f3ac2a731baeeaea2b732913f3
BLAKE2b-256 641e760ba4b0f9febe93dd3dbb8f102c830fe9ecf83943bb6b430cf75f25c6c5

See more details on using hashes here.

File details

Details for the file django_cloud_storage-1.0.7-py3-none-any.whl.

File metadata

File hashes

Hashes for django_cloud_storage-1.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 0164a144b7f322c4adffec4b62a80202d75fc5cfddc09e38df26c6f83017ee08
MD5 02df199efc7125ed8e98dec8c098f20a
BLAKE2b-256 e6f7a648c6dcb9663fd1b32611e70896f6051dfd779b53ed82ee35c4d00f9b94

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.7 This release

2 files

1.0.6

2 files

1.0.5

2 files

1.0.4

2 files

1.0.3

2 files

Supported by

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