Skip to content

Commit 34e8bd5

Browse files
committed
fix(run/django): update bucket permissions, testing
Carry over from #13742
1 parent 7752b24 commit 34e8bd5

3 files changed

Lines changed: 18 additions & 5 deletions

File tree

run/django/mysite/settings.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,26 @@
174174
STORAGES = {
175175
"default": {
176176
"BACKEND": "storages.backends.gcloud.GoogleCloudStorage",
177+
"options": {
178+
"bucket_name": GS_BUCKET_NAME,
179+
"querystring_auth": True, # Enable signed URLs
180+
"default_acl": None, # No ACLs required due to uniform level access on your bucket
181+
"expiration": 300,
182+
"iam_sign_blob": True, # Use the IAM Sign Blob API
183+
},
177184
},
178185
"staticfiles": {
179186
"BACKEND": "storages.backends.gcloud.GoogleCloudStorage",
187+
"options": {
188+
"bucket_name": GS_BUCKET_NAME,
189+
"querystring_auth": True, # Enable signed URLs
190+
"default_acl": None, # No ACLs required due to uniform level access on your bucket
191+
"expiration": 300,
192+
"iam_sign_blob": True, # Use the IAM Sign Blob API
193+
},
180194
},
181195
}
182-
GS_DEFAULT_ACL = "publicRead"
196+
GS_DEFAULT_ACL = None
183197
# [END cloudrun_django_static_config]
184198

185199
# Default primary key field type

run/django/noxfile_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
TEST_CONFIG_OVERRIDE = {
2424
# You can opt out from the test for specific Python versions.
25-
"ignored_versions": ["2.7", "3.6", "3.7", "3.8"],
25+
"ignored_versions": ["2.7", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"],
2626
# Old samples are opted out of enforcing Python type hints
2727
# All new samples should feature the
2828
"enforce_type_hints": True,

run/django/requirements.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
Django==5.2.5; python_version >= "3.10"
2-
Django==4.2.24; python_version >= "3.8" and python_version < "3.10"
1+
Django==6.0.2
32
django-storages[google]==1.14.6
43
django-environ==0.12.0
5-
psycopg2-binary==2.9.10
4+
psycopg2-binary==2.9.11
65
gunicorn==23.0.0
76
google-cloud-secret-manager==2.21.1

0 commit comments

Comments
 (0)