Skip to main content

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 GPAC_STORAGE settings dict:

GPAC_STORAGE = {
    "allow_overwrite": False,
    "bucket": "my-bucket",
    "cache_control": "public, max-age=3600",
    "path_prefix": "",
}

GPAC_STORAGE["allow_overwrite"]

Default: False

If True, the storage backend will overwrite an existing object with the same name.

GPAC_STORAGE["bucket"]

Default: os.environ["GCS_BUCKET"]

GPAC_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.

GPAC_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


Download files

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

Source Distribution

django-gapc-storage-0.3.1.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

django_gapc_storage-0.3.1-py2.py3-none-any.whl (6.3 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django-gapc-storage-0.3.1.tar.gz.

File metadata

File hashes

Hashes for django-gapc-storage-0.3.1.tar.gz
Algorithm Hash digest
SHA256 79ee674d83a3abbe875dda9134f4d71904bb587c417d2249a404b306b0b7cb9a
MD5 e2501a310858a1ce69fabdb95638d877
BLAKE2b-256 637f1c9b44caf1b6d837da94b76007122e1885e4f2a986cbcbb24aa39cbbe4ea

See more details on using hashes here.

File details

Details for the file django_gapc_storage-0.3.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_gapc_storage-0.3.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a2a1852d1181d15dcc344592b6413855d73a6656ae0baac21d55284a27d57381
MD5 9f509fb71a07a9830910124893713402
BLAKE2b-256 8e8c572cbe60ac8e0d1a0d1eea2b5a390a08a56c142f779e486d87e3aa8d4b68

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page