From 9937b4c90db055695bf12ee8671ee5a5188b34c2 Mon Sep 17 00:00:00 2001 From: Jacob Wegner Date: Fri, 16 Dec 2016 15:51:52 -0600 Subject: [PATCH 1/2] document storage backend settings resolves #2 --- README.rst | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/README.rst b/README.rst index 38105be..c81f400 100644 --- a/README.rst +++ b/README.rst @@ -13,3 +13,49 @@ 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``. From b35ae9f124704ea64da88268665eacc325adb291 Mon Sep 17 00:00:00 2001 From: Jacob Wegner Date: Fri, 16 Dec 2016 15:53:49 -0600 Subject: [PATCH 2/2] lint RST --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index c81f400..968631f 100644 --- a/README.rst +++ b/README.rst @@ -43,7 +43,7 @@ the same name. Default: ``os.environ["GCS_BUCKET"]`` ``GPAC_STORAGE["cache_control"]`` -=================================== +================================= Default: ``public, max-age=3600``