diff --git a/django/middleware/locale.py b/django/middleware/locale.py index 35128f7376..76d026f9f7 100644 --- a/django/middleware/locale.py +++ b/django/middleware/locale.py @@ -1,5 +1,6 @@ "this is the locale selecting middleware that will look at accept headers" +from django.utils.cache import patch_vary_headers from django.utils import translation # this is a cache that will build a map from modules to applications @@ -38,3 +39,7 @@ class LocaleMiddleware: translation.activate(app, lang) + def process_response(self, request, response): + patch_vary_headers(response, ('Accept-Language',)) + return response +