From a7479e02faf37da8987d5933d8c259b045ef1be8 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Sun, 27 Jan 2013 17:23:56 +0000 Subject: AJAX, CSRF & CORS documentation --- docs/api-guide/renderers.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'docs/api-guide/renderers.md') diff --git a/docs/api-guide/renderers.md b/docs/api-guide/renderers.md index b4f7ec3d..4c1fdc53 100644 --- a/docs/api-guide/renderers.md +++ b/docs/api-guide/renderers.md @@ -80,7 +80,7 @@ Renders the request data into `JSONP`. The `JSONP` media type provides a mechan The javascript callback function must be set by the client including a `callback` URL query parameter. For example `http://example.com/api/users?callback=jsonpCallback`. If the callback function is not explicitly set by the client it will default to `'callback'`. -**Note**: If you require cross-domain AJAX requests, you may also want to consider using [CORS] as an alternative to `JSONP`. +**Note**: If you require cross-domain AJAX requests, you may want to consider using the more modern approach of [CORS][cors] as an alternative to `JSONP`. See the [CORS documentation][cors-docs] for more details. **.media_type**: `application/javascript` @@ -288,7 +288,8 @@ Comma-separated values are a plain-text tabular data format, that can be easily [cite]: https://docs.djangoproject.com/en/dev/ref/template-response/#the-rendering-process [conneg]: content-negotiation.md [browser-accept-headers]: http://www.gethifi.com/blog/browser-rest-http-accept-headers -[CORS]: http://en.wikipedia.org/wiki/Cross-origin_resource_sharing +[cors]: http://www.w3.org/TR/cors/ +[cors-docs]: ../topics/ajax-csrf-cors.md [HATEOAS]: http://timelessrepo.com/haters-gonna-hateoas [quote]: http://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven [application/vnd.github+json]: http://developer.github.com/v3/media/ -- cgit v1.2.3 From 31f3fa63b2758d1e16f6814f4ac18647412bdddb Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Fri, 22 Feb 2013 08:39:50 +0000 Subject: Tweak TemplateHTMLRenderer docs. --- docs/api-guide/renderers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/api-guide/renderers.md') diff --git a/docs/api-guide/renderers.md b/docs/api-guide/renderers.md index 4c1fdc53..ca9a6694 100644 --- a/docs/api-guide/renderers.md +++ b/docs/api-guide/renderers.md @@ -115,7 +115,7 @@ The TemplateHTMLRenderer will create a `RequestContext`, using the `response.dat The template name is determined by (in order of preference): -1. An explicit `.template_name` attribute set on the response. +1. An explicit `template_name` argument passed to the response. 2. An explicit `.template_name` attribute set on this class. 3. The return result of calling `view.get_template_names()`. -- cgit v1.2.3 From b3019d9824c0ba2f907e16202f6e9400ab7ae80e Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Fri, 22 Feb 2013 20:46:20 +0000 Subject: Note requirements explicitly. --- docs/api-guide/renderers.md | 2 ++ 1 file changed, 2 insertions(+) (limited to 'docs/api-guide/renderers.md') diff --git a/docs/api-guide/renderers.md b/docs/api-guide/renderers.md index ca9a6694..5de1491b 100644 --- a/docs/api-guide/renderers.md +++ b/docs/api-guide/renderers.md @@ -90,6 +90,8 @@ The javascript callback function must be set by the client including a `callback Renders the request data into `YAML`. +Requires the `pyyaml` package to be installed. + **.media_type**: `application/yaml` **.format**: `'.yaml'` -- cgit v1.2.3 From 70db39859586aa49b6065ee1625fbfba3b50ae23 Mon Sep 17 00:00:00 2001 From: Danilo Bargen Date: Mon, 25 Feb 2013 21:31:12 +0100 Subject: Renamed UserInstance to UserDetail in docs --- docs/api-guide/renderers.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/api-guide/renderers.md') diff --git a/docs/api-guide/renderers.md b/docs/api-guide/renderers.md index 5de1491b..3c8396aa 100644 --- a/docs/api-guide/renderers.md +++ b/docs/api-guide/renderers.md @@ -123,7 +123,7 @@ The template name is determined by (in order of preference): An example of a view that uses `TemplateHTMLRenderer`: - class UserInstance(generics.RetrieveUserAPIView): + class UserDetail(generics.RetrieveUserAPIView): """ A view that returns a templated HTML representations of a given user. """ @@ -301,4 +301,4 @@ Comma-separated values are a plain-text tabular data format, that can be easily [juanriaza]: https://github.com/juanriaza [mjumbewu]: https://github.com/mjumbewu [djangorestframework-msgpack]: https://github.com/juanriaza/django-rest-framework-msgpack -[djangorestframework-csv]: https://github.com/mjumbewu/django-rest-framework-csv \ No newline at end of file +[djangorestframework-csv]: https://github.com/mjumbewu/django-rest-framework-csv -- cgit v1.2.3