aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorkahnjw2013-12-06 14:22:08 -0800
committerkahnjw2013-12-06 14:22:08 -0800
commit100a933279e3119e2627d744cd7eb472b542f6fe (patch)
tree6826d3f2529d00b242d904166dd510c597b9a523 /docs
parent89f26c5e040febd27bc9142b0096ca119bb3fa32 (diff)
downloaddjango-rest-framework-100a933279e3119e2627d744cd7eb472b542f6fe.tar.bz2
Add documentation to explain what effect these changes have.
Diffstat (limited to 'docs')
-rw-r--r--docs/api-guide/throttling.md7
1 files changed, 6 insertions, 1 deletions
diff --git a/docs/api-guide/throttling.md b/docs/api-guide/throttling.md
index cc469217..ee57383c 100644
--- a/docs/api-guide/throttling.md
+++ b/docs/api-guide/throttling.md
@@ -35,11 +35,16 @@ The default throttling policy may be set globally, using the `DEFAULT_THROTTLE_C
'DEFAULT_THROTTLE_RATES': {
'anon': '100/day',
'user': '1000/day'
- }
+ },
+ 'NUM_PROXIES': 2,
}
The rate descriptions used in `DEFAULT_THROTTLE_RATES` may include `second`, `minute`, `hour` or `day` as the throttle period.
+By default Django REST Framework will try to use the `HTTP_X_FORWARDED_FOR` header to uniquely identify client machines for throttling. If HTTP_X_FORWARDED_FOR is not present `REMOTE_ADDR` header value will be used.
+
+To help Django REST Framework identify unique clients the number of application proxies can be set using `NUM_PROXIES`. This setting will allow the throttle to correctly identify unique requests whenthere are multiple application side proxies in front of the server. `NUM_PROXIES` should be set to an integer. It is important to understand that if you configure `NUM_PROXIES > 0` all clients behind a unique [NAT'd](http://en.wikipedia.org/wiki/Network_address_translation) gateway will be treated as a single client.
+
You can also set the throttling policy on a per-view or per-viewset basis,
using the `APIView` class based views.