From 9330d1aaf133019afdfbab73323e8da1fde64107 Mon Sep 17 00:00:00 2001 From: Genevieve Brooks Date: Fri, 12 Sep 2025 13:50:30 -0700 Subject: [PATCH 1/2] Fixed Language chooser middleware warning during tests --- pydotorg/settings/base.py | 2 ++ pydotorg/urls.py | 3 +++ 2 files changed, 5 insertions(+) diff --git a/pydotorg/settings/base.py b/pydotorg/settings/base.py index 2c392b355..26dd98c72 100644 --- a/pydotorg/settings/base.py +++ b/pydotorg/settings/base.py @@ -157,6 +157,7 @@ ROOT_URLCONF = 'pydotorg.urls' + # Note that we don't need to activate 'XFrameOptionsMiddleware' and # 'SecurityMiddleware' because we set appropriate headers in python/psf-salt. MIDDLEWARE = [ @@ -172,6 +173,7 @@ 'pages.middleware.PageFallbackMiddleware', 'django.contrib.redirects.middleware.RedirectFallbackMiddleware', 'allauth.account.middleware.AccountMiddleware', + 'django.middleware.locale.LocaleMiddleware' ] AUTH_USER_MODEL = 'users.User' diff --git a/pydotorg/urls.py b/pydotorg/urls.py index 8a70d5790..b02c83f00 100644 --- a/pydotorg/urls.py +++ b/pydotorg/urls.py @@ -73,6 +73,9 @@ # storage migration re_path(r'^m/(?P.*)/$', views.MediaMigrationView.as_view(prefix='media'), name='media_migration_view'), + + # i18n + path('i18n/', include('django.conf.urls.i18n')), ] urlpatterns += staticfiles_urlpatterns() From bdc1db37a7ce817f15e24888e1d72b38a41bb8d5 Mon Sep 17 00:00:00 2001 From: Genevieve Brooks Date: Fri, 12 Sep 2025 14:13:09 -0700 Subject: [PATCH 2/2] fixed small formatting issue --- pydotorg/settings/base.py | 1 - 1 file changed, 1 deletion(-) diff --git a/pydotorg/settings/base.py b/pydotorg/settings/base.py index 26dd98c72..3674b06e1 100644 --- a/pydotorg/settings/base.py +++ b/pydotorg/settings/base.py @@ -157,7 +157,6 @@ ROOT_URLCONF = 'pydotorg.urls' - # Note that we don't need to activate 'XFrameOptionsMiddleware' and # 'SecurityMiddleware' because we set appropriate headers in python/psf-salt. MIDDLEWARE = [