diff --git a/appengine/flexible/django_cloudsql/mysite/settings.py b/appengine/flexible/django_cloudsql/mysite/settings.py index a4d4fab55646..d617a6cc5b08 100644 --- a/appengine/flexible/django_cloudsql/mysite/settings.py +++ b/appengine/flexible/django_cloudsql/mysite/settings.py @@ -158,7 +158,6 @@ USE_I18N = True -USE_L10N = True USE_TZ = True @@ -168,8 +167,14 @@ # Define static storage via django-storages[google] GS_BUCKET_NAME = env("GS_BUCKET_NAME") STATIC_URL = "/static/" -DEFAULT_FILE_STORAGE = "storages.backends.gcloud.GoogleCloudStorage" -STATICFILES_STORAGE = "storages.backends.gcloud.GoogleCloudStorage" +STORAGES = { + "default": { + "BACKEND": "storages.backends.gcloud.GoogleCloudStorage", + }, + "staticfiles": { + "BACKEND": "storages.backends.gcloud.GoogleCloudStorage", + }, +} GS_DEFAULT_ACL = "publicRead" # [END gaeflex_py_django_static_config] # [END staticurl] diff --git a/appengine/flexible/django_cloudsql/polls/urls.py b/appengine/flexible/django_cloudsql/polls/urls.py index 0e60b4c49208..ca52d7490438 100644 --- a/appengine/flexible/django_cloudsql/polls/urls.py +++ b/appengine/flexible/django_cloudsql/polls/urls.py @@ -12,10 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.urls import re_path +from django.urls import path from . import views urlpatterns = [ - re_path(r"^$", views.index, name="index"), + path("", views.index, name="index"), ] diff --git a/appengine/flexible/django_cloudsql/requirements.txt b/appengine/flexible/django_cloudsql/requirements.txt index 9225cf8ef092..dac86ddf357f 100644 --- a/appengine/flexible/django_cloudsql/requirements.txt +++ b/appengine/flexible/django_cloudsql/requirements.txt @@ -1,5 +1,5 @@ -Django==5.0.4; python_version >= "3.10" -Django==4.2.13; python_version < "3.10" +Django==5.1; python_version >= "3.10" +Django==4.2.15; python_version >= "3.8" and python_version < "3.10" gunicorn==22.0.0 psycopg2-binary==2.9.9 django-environ==0.11.2 diff --git a/appengine/flexible/hello_world_django/project_name/urls.py b/appengine/flexible/hello_world_django/project_name/urls.py index 5db28f43ca3e..9a393bb42d29 100644 --- a/appengine/flexible/hello_world_django/project_name/urls.py +++ b/appengine/flexible/hello_world_django/project_name/urls.py @@ -12,28 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""project_name URL Configuration - -The `urlpatterns` list routes URLs to views. For more information please see: - https://docs.djangoproject.com/en/stable/topics/http/urls/ -Examples: -Function views - 1. Add an import: from my_app import views - 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') -Class-based views - 1. Add an import: from other_app.views import Home - 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') -Including another URLconf - 1. Add an import: from blog import urls as blog_urls - 2. Add a URL to urlpatterns: url(r'^blog/', include(blog_urls)) -""" -from django.conf.urls import include, url from django.contrib import admin +from django.urls import include, path import helloworld.views urlpatterns = [ - url(r"^admin/", include(admin.site.urls)), - url(r"^$", helloworld.views.index), + path("admin/", include(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 d84a1cf115b0..42b984a04dbb 100644 --- a/appengine/flexible/hello_world_django/requirements.txt +++ b/appengine/flexible/hello_world_django/requirements.txt @@ -1,4 +1,4 @@ -Django==5.0.4; python_version >= "3.10" -Django==4.2.13; python_version >= "3.8" and python_version < "3.10" +Django==5.1; python_version >= "3.10" +Django==4.2.15; python_version >= "3.8" and python_version < "3.10" Django==3.2.25; python_version < "3.8" gunicorn==22.0.0 diff --git a/appengine/flexible_python37_and_earlier/django_cloudsql/polls/urls.py b/appengine/flexible_python37_and_earlier/django_cloudsql/polls/urls.py index 0e60b4c49208..ca52d7490438 100644 --- a/appengine/flexible_python37_and_earlier/django_cloudsql/polls/urls.py +++ b/appengine/flexible_python37_and_earlier/django_cloudsql/polls/urls.py @@ -12,10 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.urls import re_path +from django.urls import path from . import views urlpatterns = [ - re_path(r"^$", views.index, name="index"), + path("", views.index, name="index"), ] diff --git a/appengine/flexible_python37_and_earlier/django_cloudsql/requirements.txt b/appengine/flexible_python37_and_earlier/django_cloudsql/requirements.txt index 935c59c205fb..ec2f6fe0b35a 100644 --- a/appengine/flexible_python37_and_earlier/django_cloudsql/requirements.txt +++ b/appengine/flexible_python37_and_earlier/django_cloudsql/requirements.txt @@ -1,5 +1,5 @@ -Django==5.0.4; python_version >= "3.10" -Django==4.2.13; python_version >= "3.8" and python_version < "3.10" +Django==5.1; python_version >= "3.10" +Django==4.2.15; python_version >= "3.8" and python_version < "3.10" Django==3.2.25; python_version < "3.8" gunicorn==22.0.0 psycopg2-binary==2.9.9 diff --git a/appengine/flexible_python37_and_earlier/hello_world_django/project_name/urls.py b/appengine/flexible_python37_and_earlier/hello_world_django/project_name/urls.py index 5db28f43ca3e..9a393bb42d29 100644 --- a/appengine/flexible_python37_and_earlier/hello_world_django/project_name/urls.py +++ b/appengine/flexible_python37_and_earlier/hello_world_django/project_name/urls.py @@ -12,28 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""project_name URL Configuration - -The `urlpatterns` list routes URLs to views. For more information please see: - https://docs.djangoproject.com/en/stable/topics/http/urls/ -Examples: -Function views - 1. Add an import: from my_app import views - 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') -Class-based views - 1. Add an import: from other_app.views import Home - 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') -Including another URLconf - 1. Add an import: from blog import urls as blog_urls - 2. Add a URL to urlpatterns: url(r'^blog/', include(blog_urls)) -""" -from django.conf.urls import include, url from django.contrib import admin +from django.urls import include, path import helloworld.views urlpatterns = [ - url(r"^admin/", include(admin.site.urls)), - url(r"^$", helloworld.views.index), + path("admin/", include(admin.site.urls)), + path("", helloworld.views.index), ] diff --git a/appengine/flexible_python37_and_earlier/hello_world_django/requirements.txt b/appengine/flexible_python37_and_earlier/hello_world_django/requirements.txt index 18ab332f2f54..42b984a04dbb 100644 --- a/appengine/flexible_python37_and_earlier/hello_world_django/requirements.txt +++ b/appengine/flexible_python37_and_earlier/hello_world_django/requirements.txt @@ -1,5 +1,4 @@ -Django==5.0.4; python_version >= "3.10" -Django==5.0.3; python_version >= "3.10" -Django==4.2.13; python_version >= "3.8" and python_version < "3.10" +Django==5.1; python_version >= "3.10" +Django==4.2.15; python_version >= "3.8" and python_version < "3.10" Django==3.2.25; python_version < "3.8" gunicorn==22.0.0 diff --git a/appengine/standard_python3/bundled-services/blobstore/django/requirements.txt b/appengine/standard_python3/bundled-services/blobstore/django/requirements.txt index 3843d847802b..f1d0761e37a5 100644 --- a/appengine/standard_python3/bundled-services/blobstore/django/requirements.txt +++ b/appengine/standard_python3/bundled-services/blobstore/django/requirements.txt @@ -1,5 +1,5 @@ -Django==5.0.7; python_version >= "3.10" -Django==4.2.8; python_version < "3.10" +Django==5.1; python_version >= "3.10" +Django==4.2.15; python_version < "3.10" django-environ==0.10.0 google-cloud-logging==3.5.0 -appengine-python-standard>=0.2.3 \ No newline at end of file +appengine-python-standard>=0.2.3 diff --git a/appengine/standard_python3/bundled-services/deferred/django/requirements.txt b/appengine/standard_python3/bundled-services/deferred/django/requirements.txt index 8739397bb8a7..1a783c651eca 100644 --- a/appengine/standard_python3/bundled-services/deferred/django/requirements.txt +++ b/appengine/standard_python3/bundled-services/deferred/django/requirements.txt @@ -1,6 +1,6 @@ -Django==5.0.3; python_version >= "3.10" -Django==4.2.8; python_version >= "3.8" and python_version < "3.10" -Django==3.2.23; python_version < "3.8" +Django==5.1; python_version >= "3.10" +Django==4.2.15; python_version >= "3.8" and python_version < "3.10" +Django==3.2.25; python_version < "3.8" django-environ==0.10.0 google-cloud-logging==3.5.0 -appengine-python-standard>=0.3.1 \ No newline at end of file +appengine-python-standard>=0.3.1 diff --git a/appengine/standard_python3/bundled-services/mail/django/main.py b/appengine/standard_python3/bundled-services/mail/django/main.py index 33339fd9407b..7425754e658a 100644 --- a/appengine/standard_python3/bundled-services/mail/django/main.py +++ b/appengine/standard_python3/bundled-services/mail/django/main.py @@ -17,6 +17,7 @@ from django.conf import settings from django.core.wsgi import get_wsgi_application from django.http import HttpResponse +from django.urls import path from django.urls import re_path from google.appengine.api import mail, wrap_wsgi_app @@ -105,9 +106,9 @@ def receive_bounce(request): urlpatterns = [ - re_path(r"^$", home_page), + path("", home_page), re_path(r"^_ah/mail/.*$", receive_mail), - re_path(r"^_ah/bounce$", receive_bounce), + path("_ah/bounce", receive_bounce), ] settings.configure( diff --git a/appengine/standard_python3/bundled-services/mail/django/requirements.txt b/appengine/standard_python3/bundled-services/mail/django/requirements.txt index d44d4600d3a9..0b36beea3ce7 100644 --- a/appengine/standard_python3/bundled-services/mail/django/requirements.txt +++ b/appengine/standard_python3/bundled-services/mail/django/requirements.txt @@ -1,6 +1,6 @@ -Django==5.0.7; python_version >= "3.10" -Django==4.2.8; python_version >= "3.8" and python_version < "3.10" -Django==3.2.23; python_version < "3.8" +Django==5.1; python_version >= "3.10" +Django==4.2.15; python_version >= "3.8" and python_version < "3.10" +Django==3.2.25; python_version < "3.8" django-environ==0.10.0 google-cloud-logging==3.5.0 -appengine-python-standard>=0.2.3 \ No newline at end of file +appengine-python-standard>=0.2.3 diff --git a/appengine/standard_python3/django/requirements.txt b/appengine/standard_python3/django/requirements.txt index dfd82374f718..e61d6632d44c 100644 --- a/appengine/standard_python3/django/requirements.txt +++ b/appengine/standard_python3/django/requirements.txt @@ -1,6 +1,6 @@ -Django==5.0.3; python_version >= "3.10" -Django==4.2.8; python_version >= "3.8" and python_version < "3.10" -Django==3.2.23; python_version < "3.8" +Django==5.1; python_version >= "3.10" +Django==4.2.15; python_version >= "3.8" and python_version < "3.10" +Django==3.2.25; python_version < "3.8" django-environ==0.10.0 psycopg2-binary==2.9.9 google-cloud-secret-manager==2.16.1 diff --git a/kubernetes_engine/django_tutorial/requirements.txt b/kubernetes_engine/django_tutorial/requirements.txt index a3cd05dc633e..9b779e713d59 100644 --- a/kubernetes_engine/django_tutorial/requirements.txt +++ b/kubernetes_engine/django_tutorial/requirements.txt @@ -1,4 +1,4 @@ -Django==5.0.4; python_version >= "3.10" +Django==5.1; python_version >= "3.10" Django==4.2.13; python_version >= "3.8" and python_version < "3.10" Django==3.2.25; python_version < "3.8" # Uncomment the mysqlclient requirement if you are using MySQL rather than diff --git a/run/django/mysite/settings.py b/run/django/mysite/settings.py index f7ec80e5bd1f..65fe627a4886 100644 --- a/run/django/mysite/settings.py +++ b/run/django/mysite/settings.py @@ -161,7 +161,6 @@ USE_I18N = True -USE_L10N = True USE_TZ = True @@ -170,8 +169,14 @@ # Define static storage via django-storages[google] GS_BUCKET_NAME = env("GS_BUCKET_NAME") STATIC_URL = "/static/" -DEFAULT_FILE_STORAGE = "storages.backends.gcloud.GoogleCloudStorage" -STATICFILES_STORAGE = "storages.backends.gcloud.GoogleCloudStorage" +STORAGES = { + "default": { + "BACKEND": "storages.backends.gcloud.GoogleCloudStorage", + }, + "staticfiles": { + "BACKEND": "storages.backends.gcloud.GoogleCloudStorage", + }, +} GS_DEFAULT_ACL = "publicRead" # [END cloudrun_django_static_config] diff --git a/run/django/requirements.txt b/run/django/requirements.txt index 2d7b47268e48..3e04150ffa05 100644 --- a/run/django/requirements.txt +++ b/run/django/requirements.txt @@ -1,4 +1,4 @@ -Django==5.0.4; python_version >= "3.10" +Django==5.1; python_version >= "3.10" Django==4.2.13; python_version >= "3.8" and python_version < "3.10" Django==3.2.25; python_version < "3.8" django-storages[google]==1.14.2