From 5e7547cd3f6d52797dfc4362447c2871ba976e41 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Thu, 5 Dec 2013 09:01:46 +0000 Subject: Latest docs build --- api-guide/renderers.html | 5 ++++- api-guide/views.html | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/api-guide/renderers.html b/api-guide/renderers.html index cb723e6a..1441b7ba 100644 --- a/api-guide/renderers.html +++ b/api-guide/renderers.html @@ -311,7 +311,10 @@ def user_count_view(request, format=None):
Renders the request data into JSONP. The JSONP media type provides a mechanism of allowing cross-domain AJAX requests, by wrapping a JSON response in a javascript callback.
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 want to consider using the more modern approach of CORS as an alternative to JSONP. See the CORS documentation for more details.
Warning: If you require cross-domain AJAX requests, you should almost certainly be using the more modern approach of CORS as an alternative to JSONP. See the CORS documentation for more details.
The jsonp approach is essentially a browser hack, and is only appropriate for globally readable API endpoints, where GET requests are unauthenticated and do not require any user permissions.
.media_type: application/javascript
.format: '.jsonp'
.charset: utf-8
This view will use the default renderers, parsers, authentication classes etc specified in the settings.
+This view will use the default renderers, parsers, authentication classes etc specified in the settings.
To override the default settings, REST framework provides a set of additional decorators which can be added to your views. These must come after (below) the @api_view decorator. For example, to create a view that uses a throttle to ensure it can only be called once per day by a particular user, use the @throttle_classes decorator, passing a list of throttle classes:
To override the default settings, REST framework provides a set of additional decorators which can be added to your views. These must come after (below) the @api_view decorator. For example, to create a view that uses a throttle to ensure it can only be called once per day by a particular user, use the @throttle_classes decorator, passing a list of throttle classes:
from rest_framework.decorators import api_view, throttle_classes
from rest_framework.throttling import UserRateThrottle
--
cgit v1.2.3