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
    

Release files for django-cloud-storage 1.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-cloud-storage 1.0.7
File Size Uploaded
django_cloud_storage-1.0.7.tar.gz 7.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-cloud-storage 1.0.7
File Interpreter ABI Platform
django_cloud_storage-1.0.7-py3-none-any.whl Python 3 none any Details

Total release size: 13.8 kB

Release files / django_cloud_storage-1.0.7.tar.gz

Download URL django_cloud_storage-1.0.7.tar.gz
Size 7.1 kB
Tags Source
SHA-256 checksum
How to use checksums
39017b19c5a524b25f389e52d39756e190d5de8ca93b95a6a45e121da37e6850
BLAKE2b-256 checksum
How to use checksums
641e760ba4b0f9febe93dd3dbb8f102c830fe9ecf83943bb6b430cf75f25c6c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / django_cloud_storage-1.0.7-py3-none-any.whl

Download URL django_cloud_storage-1.0.7-py3-none-any.whl
Size 6.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0164a144b7f322c4adffec4b62a80202d75fc5cfddc09e38df26c6f83017ee08
BLAKE2b-256 checksum
How to use checksums
e6f7a648c6dcb9663fd1b32611e70896f6051dfd779b53ed82ee35c4d00f9b94
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release history Release notifications | RSS feed

This release

1.0.7 This release

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page