From bcc2befd0e9c1885e45b46d0b0bcdc11def8b249 Mon Sep 17 00:00:00 2001 From: Tom Carrick Date: Tue, 14 Jul 2020 13:32:24 +0200 Subject: Fixed #31789 -- Added a new headers interface to HttpResponse. --- docs/topics/class-based-views/index.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/topics/class-based-views') diff --git a/docs/topics/class-based-views/index.txt b/docs/topics/class-based-views/index.txt index 3ec00f7361..8874545469 100644 --- a/docs/topics/class-based-views/index.txt +++ b/docs/topics/class-based-views/index.txt @@ -119,7 +119,7 @@ And the view:: last_book = self.get_queryset().latest('publication_date') response = HttpResponse() # RFC 1123 date format - response['Last-Modified'] = last_book.publication_date.strftime('%a, %d %b %Y %H:%M:%S GMT') + response.headers['Last-Modified'] = last_book.publication_date.strftime('%a, %d %b %Y %H:%M:%S GMT') return response If the view is accessed from a ``GET`` request, an object list is returned in -- cgit v1.3