From b85886a3c79a45baded1abbfa389a4c8d5c6966e Mon Sep 17 00:00:00 2001 From: David del Real Sifuentes Date: Wed, 7 Jan 2026 22:40:44 +0000 Subject: [PATCH 1/4] chore: updating Django and python versions in requirements, CI-CD/Nox files. b/470283288 Updated Django version to 6.0.1. Updated required python version to 3.12 (minimum version required by Django 6.0.1) --- kubernetes_engine/django_tutorial/requirements.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kubernetes_engine/django_tutorial/requirements.txt b/kubernetes_engine/django_tutorial/requirements.txt index 1ef339da5ba..305133d86ad 100644 --- a/kubernetes_engine/django_tutorial/requirements.txt +++ b/kubernetes_engine/django_tutorial/requirements.txt @@ -1,5 +1,4 @@ -Django==5.2.9; python_version >= "3.10" -Django==4.2.24; python_version >= "3.8" and python_version < "3.10" +Django==6.0.1; python_version >= "3.12" # Uncomment the mysqlclient requirement if you are using MySQL rather than # PostgreSQL. You must also have a MySQL client installed in that case. #mysqlclient==1.4.1 From 95d4a9b0dc71210a33181863440f483179f6b023 Mon Sep 17 00:00:00 2001 From: David del Real Sifuentes Date: Thu, 8 Jan 2026 16:28:47 +0000 Subject: [PATCH 2/4] chore: Updated requirements for App Engine Django Flexible Environment b/470283244 - Updated Django and python version in requirements file. - Updated and added missing attributes for frameworks's execution. --- appengine/flexible/hello_world_django/noxfile_config.py | 2 +- appengine/flexible/hello_world_django/project_name/settings.py | 2 ++ appengine/flexible/hello_world_django/project_name/urls.py | 2 +- appengine/flexible/hello_world_django/requirements.txt | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/appengine/flexible/hello_world_django/noxfile_config.py b/appengine/flexible/hello_world_django/noxfile_config.py index 196376e7023..692b834f789 100644 --- a/appengine/flexible/hello_world_django/noxfile_config.py +++ b/appengine/flexible/hello_world_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.7"], + "ignored_versions": ["2.7", "3.7", "3.8", "3.9", "3.10", "3.11"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": False, diff --git a/appengine/flexible/hello_world_django/project_name/settings.py b/appengine/flexible/hello_world_django/project_name/settings.py index f8b93099d56..bd094b5f576 100644 --- a/appengine/flexible/hello_world_django/project_name/settings.py +++ b/appengine/flexible/hello_world_django/project_name/settings.py @@ -114,3 +114,5 @@ # https://docs.djangoproject.com/en/stable/howto/static-files/ STATIC_URL = "/static/" + +STATIC_ROOT = os.path.join(BASE_DIR, 'static') diff --git a/appengine/flexible/hello_world_django/project_name/urls.py b/appengine/flexible/hello_world_django/project_name/urls.py index 9a393bb42d2..5928814711e 100644 --- a/appengine/flexible/hello_world_django/project_name/urls.py +++ b/appengine/flexible/hello_world_django/project_name/urls.py @@ -19,6 +19,6 @@ urlpatterns = [ - path("admin/", include(admin.site.urls)), + path("admin/", admin.site.urls), path("", helloworld.views.index), ] diff --git a/appengine/flexible/hello_world_django/requirements.txt b/appengine/flexible/hello_world_django/requirements.txt index 435ef2cb8ee..a7f029a554d 100644 --- a/appengine/flexible/hello_world_django/requirements.txt +++ b/appengine/flexible/hello_world_django/requirements.txt @@ -1,2 +1,2 @@ -Django==5.2.9 +Django==6.0.1; python_version >= "3.12" gunicorn==23.0.0 From 03db4414bb33a4412a4247308c7604028ca19bd0 Mon Sep 17 00:00:00 2001 From: David del Real Sifuentes Date: Fri, 9 Jan 2026 21:01:55 +0000 Subject: [PATCH 3/4] chore: Updated requirements for Run Django b/470283502 - Updated Django and python version in requirements and nox files. --- run/django/noxfile_config.py | 2 +- run/django/requirements.txt | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/run/django/noxfile_config.py b/run/django/noxfile_config.py index e928b32a2d2..c8a36780cd0 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"], # 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..1f87eae2dbe 100644 --- a/run/django/requirements.txt +++ b/run/django/requirements.txt @@ -1,5 +1,4 @@ -Django==5.2.5; python_version >= "3.10" -Django==4.2.24; python_version >= "3.8" and python_version < "3.10" +Django==6.0.1; python_version >= "3.12" django-storages[google]==1.14.6 django-environ==0.12.0 psycopg2-binary==2.9.10 From 3b0c1c0ed856d1e6f684b39864189ca2d75db392 Mon Sep 17 00:00:00 2001 From: David del Real Sifuentes Date: Mon, 12 Jan 2026 18:01:02 +0000 Subject: [PATCH 4/4] chore: Update requirements for Django Cloud SQL - Updated requirements and nox files for latest Django version. --- .../flexible/django_cloudsql/noxfile_config.py | 2 +- .../flexible/django_cloudsql/requirements.txt | 4 ++-- appengine/flexible/hello_world_django/app.yaml | 2 +- .../hello_world_django/project_name/urls.py | 2 +- kubernetes_engine/django_tutorial/requirements.txt | 2 +- run/django/mysite/settings.py | 14 ++++++++++++++ run/django/noxfile_config.py | 2 +- run/django/requirements.txt | 2 +- 8 files changed, 22 insertions(+), 8 deletions(-) diff --git a/appengine/flexible/django_cloudsql/noxfile_config.py b/appengine/flexible/django_cloudsql/noxfile_config.py index 30010ba672d..60e19bd8a96 100644 --- a/appengine/flexible/django_cloudsql/noxfile_config.py +++ b/appengine/flexible/django_cloudsql/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.7", "3.8", "3.10", "3.12", "3.13"], + "ignored_versions": ["2.7", "3.7", "3.8", "3.9", "3.10", "3.11"], # An envvar key for determining the project id to use. Change it # to 'BUILD_SPECIFIC_GCLOUD_PROJECT' if you want to opt in using a # build specific Cloud project. You can also use your own string diff --git a/appengine/flexible/django_cloudsql/requirements.txt b/appengine/flexible/django_cloudsql/requirements.txt index e309f97d5bc..da90b09edaa 100644 --- a/appengine/flexible/django_cloudsql/requirements.txt +++ b/appengine/flexible/django_cloudsql/requirements.txt @@ -1,6 +1,6 @@ -Django==5.2.9 +Django==6.0.1; python_version >= "3.12" gunicorn==23.0.0 -psycopg2-binary==2.9.10 +psycopg2-binary==2.9.11 django-environ==0.12.0 google-cloud-secret-manager==2.21.1 django-storages[google]==1.14.6 diff --git a/appengine/flexible/hello_world_django/app.yaml b/appengine/flexible/hello_world_django/app.yaml index 62b74a9c27e..85096c4adc4 100644 --- a/appengine/flexible/hello_world_django/app.yaml +++ b/appengine/flexible/hello_world_django/app.yaml @@ -17,4 +17,4 @@ env: flex entrypoint: gunicorn -b :$PORT project_name.wsgi runtime_config: - python_version: 3 + operating_system: "ubuntu24" diff --git a/appengine/flexible/hello_world_django/project_name/urls.py b/appengine/flexible/hello_world_django/project_name/urls.py index 5928814711e..7d3a1e0f315 100644 --- a/appengine/flexible/hello_world_django/project_name/urls.py +++ b/appengine/flexible/hello_world_django/project_name/urls.py @@ -13,7 +13,7 @@ # limitations under the License. from django.contrib import admin -from django.urls import include, path +from django.urls import path import helloworld.views diff --git a/kubernetes_engine/django_tutorial/requirements.txt b/kubernetes_engine/django_tutorial/requirements.txt index 305133d86ad..df3b50126a0 100644 --- a/kubernetes_engine/django_tutorial/requirements.txt +++ b/kubernetes_engine/django_tutorial/requirements.txt @@ -6,4 +6,4 @@ wheel==0.40.0 gunicorn==23.0.0; python_version > '3.0' gunicorn==23.0.0; python_version < '3.0' # psycopg2==2.8.4 # uncomment if you prefer to build from source -psycopg2-binary==2.9.10 +psycopg2-binary==2.9.11 diff --git a/run/django/mysite/settings.py b/run/django/mysite/settings.py index a57c07ede72..c7b678a1410 100644 --- a/run/django/mysite/settings.py +++ b/run/django/mysite/settings.py @@ -174,9 +174,23 @@ STORAGES = { "default": { "BACKEND": "storages.backends.gcloud.GoogleCloudStorage", + "options": { + "bucket_name": GS_BUCKET_NAME, + "querystring_auth": True, # generate signed URLs + "default_acl": None, # don't make files public by default + "expiration": 300, # seconds + }, }, "staticfiles": { "BACKEND": "storages.backends.gcloud.GoogleCloudStorage", + "options": { + "bucket_name": GS_BUCKET_NAME, + # You would normally have your static assets public. + # In this example, we re-use the same bucket with the same ACL settings. + "querystring_auth": True, # generate signed URLs + "default_acl": None, # don't make files public by default + "expiration": 300, # seconds + }, }, } GS_DEFAULT_ACL = "publicRead" diff --git a/run/django/noxfile_config.py b/run/django/noxfile_config.py index c8a36780cd0..6bdd6330695 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", "3.9", "3.10", "3.11"], + "ignored_versions": ["2.7", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.14"], # 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 1f87eae2dbe..ee675495a97 100644 --- a/run/django/requirements.txt +++ b/run/django/requirements.txt @@ -1,6 +1,6 @@ Django==6.0.1; python_version >= "3.12" 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