aboutsummaryrefslogtreecommitdiffstats
path: root/docs/api-guide
diff options
context:
space:
mode:
authorTom Christie2013-12-12 15:18:35 -0800
committerTom Christie2013-12-12 15:18:35 -0800
commitd6d4621c4580ae4902fc895bdca78aced0ec7eab (patch)
treedec9003eacb39906dffb7690640e0ebd694893f0 /docs/api-guide
parent36046168b62967f815e328402fcf2afad21c69fb (diff)
parent23db6c98495d7b3c18a3069c6cb770d5cbc18ee1 (diff)
downloaddjango-rest-framework-d6d4621c4580ae4902fc895bdca78aced0ec7eab.tar.bz2
Merge pull request #1273 from kahnjw/add_get_ident_method_to_base_throttle
Add get_ident method to base throttle class
Diffstat (limited to 'docs/api-guide')
-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..34418e84 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 when there 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.