1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #17942 -- Added a JsonResponse class to more easily create JSON encoded responses.

Thanks leahculver for the suggestion and Erik Romijn,
Simon Charette, and Marc Tamlyn for the reviews.
This commit is contained in:
Lukasz Balcerzak
2014-02-14 18:28:51 +01:00
committed by Tim Graham
parent e3d0790bd0
commit 0242134d32
9 changed files with 176 additions and 8 deletions

View File

@@ -671,15 +671,19 @@ Templates
* The new :tfilter:`truncatechars_html` filter truncates a string to be no
longer than the specified number of characters, taking HTML into account.
Requests
^^^^^^^^
Requests and Responses
^^^^^^^^^^^^^^^^^^^^^^
* The new :attr:`HttpRequest.scheme <django.http.HttpRequest.scheme>` attribute
specifies the scheme of the request (``http`` or ``https`` normally).
* The shortcut :func:`redirect() <django.shortcuts.redirect>` now supports
relative URLs.
* The new :class:`~django.http.JsonResponse` subclass of
:class:`~django.http.HttpResponse` helps easily create JSON-encoded responses.
Tests
^^^^^