diff options
| author | Troon <mark@tranchant.co.uk> | 2019-05-09 15:26:52 +0100 |
|---|---|---|
| committer | Carlton Gibson <carlton.gibson@noumenal.es> | 2019-05-09 16:26:52 +0200 |
| commit | a3a4f5c1447b10cee63d9fee518d0d6b5b881846 (patch) | |
| tree | a7a8e4946509ee30cb99e4e318a5314ebaf0b95a /docs/ref/request-response.txt | |
| parent | 48235ba807483fe349d2dc66aaeddc0d03f8b0d4 (diff) | |
Fixed #30310 -- Added support for looking up HttpHeaders.headers using underscores.
Diffstat (limited to 'docs/ref/request-response.txt')
| -rw-r--r-- | docs/ref/request-response.txt | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/docs/ref/request-response.txt b/docs/ref/request-response.txt index d6a336178e..58a7c3e7e4 100644 --- a/docs/ref/request-response.txt +++ b/docs/ref/request-response.txt @@ -199,6 +199,15 @@ All attributes should be considered read-only, unless stated otherwise. >>> request.headers.get('user-agent') Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) + For use in, for example, Django templates, headers can also be looked up + using underscores in place of hyphens:: + + {{ request.headers.user_agent }} + + .. versionchanged:: 3.0 + + Support for look ups using underscores was added. + .. attribute:: HttpRequest.resolver_match An instance of :class:`~django.urls.ResolverMatch` representing the |
