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 documetation](http://google.github.io/google-api-python-client/docs/epy/googleapiclient.http.HttpRequest-class.html#execute
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
Hashes for django-gapc-storage-0.4.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3940bfd54ce6df9dafe55e923ac3425e37adcfba5e2828ad5ab878d667779272 |
|
MD5 | 484db8372a9548b7915f3b0e667302f4 |
|
BLAKE2b-256 | 300e44cb70908618758cf164966dc870d5ad3c9ab9753af6e226dd98716b0dfc |
Hashes for django_gapc_storage-0.4.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea77799562486871ed3d73d666004c226920c159122cb8a291ab82e214019776 |
|
MD5 | cbc259a66e9c128398c3053be1109e27 |
|
BLAKE2b-256 | b0b5dbc88bcac4a8204a8d913dc984f6e426ebcf42e60094fadee22b5c5a8cc1 |