aboutsummaryrefslogtreecommitdiffstats
path: root/docs/api-guide/throttling.md
diff options
context:
space:
mode:
authorTom Christie2013-08-29 20:52:46 +0100
committerTom Christie2013-08-29 20:52:46 +0100
commit19f9adacb254841d02f43295baf81406ce3c60eb (patch)
treef77644b5515c15e09d49d12aef0855c67262f9ba /docs/api-guide/throttling.md
parente4d2f54529bcf538be93da5770e05b88a32da1c7 (diff)
parent02b6836ee88498861521dfff743467b0456ad109 (diff)
downloaddjango-rest-framework-19f9adacb254841d02f43295baf81406ce3c60eb.tar.bz2
Merge branch 'master' into display-raw-data
Diffstat (limited to 'docs/api-guide/throttling.md')
-rw-r--r--docs/api-guide/throttling.md7
1 files changed, 7 insertions, 0 deletions
diff --git a/docs/api-guide/throttling.md b/docs/api-guide/throttling.md
index 42f9c228..cc469217 100644
--- a/docs/api-guide/throttling.md
+++ b/docs/api-guide/throttling.md
@@ -70,6 +70,13 @@ Or, if you're using the `@api_view` decorator with function based views.
The throttle classes provided by REST framework use Django's cache backend. You should make sure that you've set appropriate [cache settings][cache-setting]. The default value of `LocMemCache` backend should be okay for simple setups. See Django's [cache documentation][cache-docs] for more details.
+If you need to use a cache other than `'default'`, you can do so by creating a custom throttle class and setting the `cache` attribute. For example:
+
+ class CustomAnonRateThrottle(AnonRateThrottle):
+ cache = get_cache('alternate')
+
+You'll need to rememeber to also set your custom throttle class in the `'DEFAULT_THROTTLE_CLASSES'` settings key, or using the `throttle_classes` view attribute.
+
---
# API Reference