diff --git a/run/django/cloudmigrate.yaml b/run/django/cloudmigrate.yaml index 8a6fc01b92b..a3e644566c6 100644 --- a/run/django/cloudmigrate.yaml +++ b/run/django/cloudmigrate.yaml @@ -16,7 +16,7 @@ steps: - id: "Build Container Image" name: gcr.io/k8s-skaffold/pack - args: ["build", "${_IMAGE_NAME}", "--builder=gcr.io/buildpacks/builder"] + args: ["build", "${_IMAGE_NAME}", "--builder=gcr.io/buildpacks/builder:google-24"] - id: "Push Container Image" name: "gcr.io/cloud-builders/docker" diff --git a/run/django/e2e_test_setup.yaml b/run/django/e2e_test_setup.yaml index dac968f03f6..3c99ccccd5a 100644 --- a/run/django/e2e_test_setup.yaml +++ b/run/django/e2e_test_setup.yaml @@ -70,7 +70,7 @@ steps: - id: "Build Container Image" name: gcr.io/k8s-skaffold/pack - args: ["build", "${_IMAGE_NAME}", "--builder=gcr.io/buildpacks/builder", + args: ["build", "${_IMAGE_NAME}", "--builder=gcr.io/buildpacks/builder:google-24", "--env", "GOOGLE_PYTHON_VERSION=${_PYTHON_VERSION}"] - id: "Push Container Image" diff --git a/run/django/mysite/settings.py b/run/django/mysite/settings.py index a57c07ede72..b04b1537a34 100644 --- a/run/django/mysite/settings.py +++ b/run/django/mysite/settings.py @@ -174,12 +174,26 @@ STORAGES = { "default": { "BACKEND": "storages.backends.gcloud.GoogleCloudStorage", + "options": { + "bucket_name": GS_BUCKET_NAME, + "querystring_auth": True, # Enable signed URLs + "default_acl": None, # No ACLs required due to uniform level access on your bucket + "expiration": 300, + "iam_sign_blob": True, # Use the IAM Sign Blob API + }, }, "staticfiles": { "BACKEND": "storages.backends.gcloud.GoogleCloudStorage", + "options": { + "bucket_name": GS_BUCKET_NAME, + "querystring_auth": True, # Enable signed URLs + "default_acl": None, # No ACLs required due to uniform level access on your bucket + "expiration": 300, + "iam_sign_blob": True, # Use the IAM Sign Blob API + }, }, } -GS_DEFAULT_ACL = "publicRead" +GS_DEFAULT_ACL = None # [END cloudrun_django_static_config] # Default primary key field type diff --git a/run/django/noxfile_config.py b/run/django/noxfile_config.py index e928b32a2d2..ac71c9368c0 100644 --- a/run/django/noxfile_config.py +++ b/run/django/noxfile_config.py @@ -22,7 +22,7 @@ TEST_CONFIG_OVERRIDE = { # You can opt out from the test for specific Python versions. - "ignored_versions": ["2.7", "3.6", "3.7", "3.8"], + "ignored_versions": ["2.7", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"], # Old samples are opted out of enforcing Python type hints # All new samples should feature the "enforce_type_hints": True, diff --git a/run/django/requirements.txt b/run/django/requirements.txt index 92897c3072e..de944d236aa 100644 --- a/run/django/requirements.txt +++ b/run/django/requirements.txt @@ -1,7 +1,6 @@ -Django==5.2.5; python_version >= "3.10" -Django==4.2.24; python_version >= "3.8" and python_version < "3.10" +Django==6.0.2 django-storages[google]==1.14.6 django-environ==0.12.0 -psycopg2-binary==2.9.10 +psycopg2-binary==2.9.11 gunicorn==23.0.0 google-cloud-secret-manager==2.21.1