aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorTom Christie2013-08-23 17:10:50 +0100
committerTom Christie2013-08-23 17:10:50 +0100
commitc7847ebc45f38e4d735b77c54ad1a55c87242fac (patch)
tree9b3c46ebda3f9d7d2aed6aaa92961e4ee8c8dd30 /docs
parentbe0f5850c398b7f7397d66eaed26d6b78163b259 (diff)
downloaddjango-rest-framework-c7847ebc45f38e4d735b77c54ad1a55c87242fac.tar.bz2
Docs for HTMLFormRenderer
Diffstat (limited to 'docs')
-rw-r--r--docs/api-guide/renderers.md14
1 files changed, 14 insertions, 0 deletions
diff --git a/docs/api-guide/renderers.md b/docs/api-guide/renderers.md
index d46d0568..c116ceda 100644
--- a/docs/api-guide/renderers.md
+++ b/docs/api-guide/renderers.md
@@ -212,6 +212,18 @@ You can use `TemplateHTMLRenderer` either to return regular HTML pages using RES
See also: `TemplateHTMLRenderer`
+## HTMLFormRenderer
+
+Renders data returned by a serializer into an HTML form. The output of this renderer does not include the enclosing `<form>` tags or an submit actions, as you'll probably need those to include the desired method and URL. Also note that the `HTMLFormRenderer` does not yet support including field error messages.
+
+**.media_type**: `text/html`
+
+**.format**: `'.form'`
+
+**.charset**: `utf-8`
+
+**.template**: `'rest_framework/form.html'`
+
## BrowsableAPIRenderer
Renders data into HTML for the Browsable API. This renderer will determine which other renderer would have been given highest priority, and use that to display an API style response within the HTML page.
@@ -222,6 +234,8 @@ Renders data into HTML for the Browsable API. This renderer will determine whic
**.charset**: `utf-8`
+**.template**: `'rest_framework/api.html'`
+
#### Customizing BrowsableAPIRenderer
By default the response content will be rendered with the highest priority renderer apart from `BrowseableAPIRenderer`. If you need to customize this behavior, for example to use HTML as the default return format, but use JSON in the browsable API, you can do so by overriding the `get_default_renderer()` method. For example: