Add notes for CORS settings on Google Cloud Storage

pull/6355/head
Katie McLaughlin 2020-08-24 16:20:57 +10:00 zatwierdzone przez Karl Hobley
rodzic 707dc171dc
commit 637000fc08
1 zmienionych plików z 20 dodań i 0 usunięć

Wyświetl plik

@ -57,4 +57,24 @@ If you are also serving Wagtail's static files from remote storage (using Django
'Access-Control-Allow-Origin': '*'
}
For Google Cloud Storage, create a ``cors.json`` configuration:
.. code-block:: json
[
{
"origin": ["*"],
"responseHeader": ["Content-Type"],
"method": ["GET"],
"maxAgeSeconds": 3600
}
]
Then, apply this CORS configuration to the storage bucket:
.. code-block:: shell
gsutil cors set cors.json gs://$GS_BUCKET_NAME
For other storage services, refer to your provider's documentation, or the documentation for the Django storage backend library you're using.