Skip to content

Commit aeeaf61

Browse files
committed
fix(run/django): use generated URLs in django-storages
b/436695635
1 parent 282ba1f commit aeeaf61

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

run/django/mysite/settings.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,23 @@
174174
STORAGES = {
175175
"default": {
176176
"BACKEND": "storages.backends.gcloud.GoogleCloudStorage",
177+
"options": {
178+
"bucket_name": GS_BUCKET_NAME,
179+
"querystring_auth": True, # generate signed URLs
180+
"default_acl": None, # don't make files public by default
181+
"expiration": 300, # seconds
182+
},
177183
},
178184
"staticfiles": {
179185
"BACKEND": "storages.backends.gcloud.GoogleCloudStorage",
186+
"options": {
187+
"bucket_name": GS_BUCKET_NAME,
188+
# You would normally have your static assets public.
189+
# In this example, we re-use the same bucket with the same ACL settings.
190+
"querystring_auth": True, # generate signed URLs
191+
"default_acl": None, # don't make files public by default
192+
"expiration": 300, # seconds
193+
},
180194
},
181195
}
182196
GS_DEFAULT_ACL = "publicRead"

0 commit comments

Comments
 (0)