summaryrefslogtreecommitdiff
path: root/docs/narr
diff options
context:
space:
mode:
Diffstat (limited to 'docs/narr')
-rw-r--r--docs/narr/renderers.rst10
1 files changed, 6 insertions, 4 deletions
diff --git a/docs/narr/renderers.rst b/docs/narr/renderers.rst
index 76035cbdf..47182c09e 100644
--- a/docs/narr/renderers.rst
+++ b/docs/narr/renderers.rst
@@ -177,8 +177,8 @@ using the API of the ``request.response`` attribute. See
.. index::
pair: renderer; JSON
-``json``: JSON Renderer
-~~~~~~~~~~~~~~~~~~~~~~~
+JSON Renderer
+~~~~~~~~~~~~~
The ``json`` renderer renders view callable results to :term:`JSON`. It
passes the return value through the ``json.dumps`` standard library function,
@@ -207,7 +207,10 @@ representing the JSON serialization of the return value:
'{"content": "Hello!"}'
The return value needn't be a dictionary, but the return value must contain
-values serializable by :func:`json.dumps`.
+values serializable by :func:`json.dumps`. Extra arguments can be passed
+to :func:`json.dumps` by overriding the default renderer. See
+:class:`pyramid.renderers.JSON` and
+:ref:`_adding_and_overriding_renderers` for more information.
You can configure a view to use the JSON renderer by naming ``json`` as the
``renderer`` argument of a view configuration, e.g. by using
@@ -221,7 +224,6 @@ You can configure a view to use the JSON renderer by naming ``json`` as the
context='myproject.resources.Hello',
renderer='json')
-
Views which use the JSON renderer can vary non-body response attributes by
using the api of the ``request.response`` attribute. See
:ref:`request_response_attr`.