a Django storage backend using GCS JSON API
Project description
django-gapc-storage
django-gapc-storage is a Django storage backend for Google Cloud Storage using the JSON API through google-api-python-client.
Requirements
Django 1.8+
Settings
Set the GCS_BUCKET environment variable to the GCS bucket to be used by the storage backend.
Settings can be customized via the GAPC_STORAGE settings dict:
GAPC_STORAGE = { "allow_overwrite": False, "bucket": "my-bucket", "cache_control": "public, max-age=3600", "num_retries": 0, "path_prefix": "", }
GAPC_STORAGE["allow_overwrite"]
Default: False
If True, the storage backend will overwrite an existing object with the same name.
GAPC_STORAGE["bucket"]
Default: os.environ["GCS_BUCKET"]
GAPC_STORAGE["cache_control"]
Default: public, max-age=3600
By default, public-readable objects on GCS have a cache duration of 60 minutes. Set cache_control to private, max-age=0 to disable public caching of objects saved by the storage backend.
GAPC_STORAGE["num_retries"]
Default: 0
Passed to the supported methods on the underlying google-api-python-client client which will retry 500 error responses with randomized exponential backoff.
For more information, see the google-api-python-client documentation.
GAPC_STORAGE["path_prefix"]
Default: ""
A prefix appended to the path of objects saved by the storage backend. For example, configuring path_prefix to media would save objects to my-bucket/media.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file django-gapc-storage-0.5.1.tar.gz
.
File metadata
- Download URL: django-gapc-storage-0.5.1.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 77f69ef3dda868f342964a16dad2ab1d2a2ccb26e7dc6153d5d4e07383e7e235 |
|
MD5 | 1c4f965e2eee5759f1637ecb0d372202 |
|
BLAKE2b-256 | 3df27ff1dd8027f418eb2c854c920471eb467cf1992472ff157951c3f6f58c45 |
File details
Details for the file django_gapc_storage-0.5.1-py2.py3-none-any.whl
.
File metadata
- Download URL: django_gapc_storage-0.5.1-py2.py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c48faad60d971eec4150f4f9301281db07263b25d8ed985cc6841081ed04cb7f |
|
MD5 | 31c353e26522b0c34f8f7dfd6ed44376 |
|
BLAKE2b-256 | dfd96a7473fe223fba7e5b1334bff5962e1dd3af725efec6f1daffb8c014321e |