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
CloudStorageas the storage backend for aFileField: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)
| File | Size | Uploaded | |
|---|---|---|---|
| django_cloud_storage-1.0.7.tar.gz | 7.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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
|