aboutsummaryrefslogtreecommitdiffstats
path: root/docs/api-guide/throttling.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/api-guide/throttling.md')
-rw-r--r--docs/api-guide/throttling.md14
1 files changed, 7 insertions, 7 deletions
diff --git a/docs/api-guide/throttling.md b/docs/api-guide/throttling.md
index 10997801..7861e9ba 100644
--- a/docs/api-guide/throttling.md
+++ b/docs/api-guide/throttling.md
@@ -29,10 +29,10 @@ If any throttle check fails an `exceptions.Throttled` exception will be raised,
The default throttling policy may be set globally, using the `DEFAULT_THROTTLES` and `DEFAULT_THROTTLE_RATES` settings. For example.
- API_SETTINGS = {
+ REST_FRAMEWORK = {
'DEFAULT_THROTTLES': (
- 'djangorestframework.throttles.AnonThrottle',
- 'djangorestframework.throttles.UserThrottle',
+ 'rest_framework.throttles.AnonThrottle',
+ 'rest_framework.throttles.UserThrottle',
)
'DEFAULT_THROTTLE_RATES': {
'anon': '100/day',
@@ -95,7 +95,7 @@ For example, multiple user throttle rates could be implemented by using the foll
...and the following settings.
- API_SETTINGS = {
+ REST_FRAMEWORK = {
'DEFAULT_THROTTLES': (
'example.throttles.BurstRateThrottle',
'example.throttles.SustainedRateThrottle',
@@ -130,9 +130,9 @@ For example, given the following views...
...and the following settings.
- API_SETTINGS = {
+ REST_FRAMEWORK = {
'DEFAULT_THROTTLES': (
- 'djangorestframework.throttles.ScopedRateThrottle',
+ 'rest_framework.throttles.ScopedRateThrottle',
)
'DEFAULT_THROTTLE_RATES': {
'contacts': '1000/day',
@@ -148,4 +148,4 @@ To create a custom throttle, override `BaseThrottle` and implement `.allow_reque
Optionally you may also override the `.wait()` method. If implemented, `.wait()` should return a recomended number of seconds to wait before attempting the next request, or `None`. The `.wait()` method will only be called if `.check_throttle()` has previously returned `False`.
-[permissions]: permissions.md \ No newline at end of file
+[permissions]: permissions.md