aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/throttling.py
diff options
context:
space:
mode:
authorBen Konrath2012-11-01 14:06:56 +0100
committerBen Konrath2012-11-01 14:06:56 +0100
commit9c82f9717e58f1bb250d5fd4b27619dbcbbd1f21 (patch)
treee976854e6871a8b826e91d8eb16d9a139b90664f /rest_framework/throttling.py
parentc24997df3b943e5d7a3b2e101508e4b79ee82dc4 (diff)
parent204db7bdaa59cd17f762d6cf0e6a8623c2cc9939 (diff)
downloaddjango-rest-framework-9c82f9717e58f1bb250d5fd4b27619dbcbbd1f21.tar.bz2
Merge branch 'master' into restframework2-filter
Diffstat (limited to 'rest_framework/throttling.py')
-rw-r--r--rest_framework/throttling.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/rest_framework/throttling.py b/rest_framework/throttling.py
index 566c277d..8fe64248 100644
--- a/rest_framework/throttling.py
+++ b/rest_framework/throttling.py
@@ -16,13 +16,13 @@ class BaseThrottle(object):
def wait(self):
"""
- Optionally, return a recommeded number of seconds to wait before
+ Optionally, return a recommended number of seconds to wait before
the next request.
"""
return None
-class SimpleRateThottle(BaseThrottle):
+class SimpleRateThrottle(BaseThrottle):
"""
A simple cache implementation, that only requires `.get_cache_key()`
to be overridden.
@@ -60,7 +60,7 @@ class SimpleRateThottle(BaseThrottle):
Determine the string representation of the allowed request rate.
"""
if not getattr(self, 'scope', None):
- msg = ("You must set either `.scope` or `.rate` for '%s' thottle" %
+ msg = ("You must set either `.scope` or `.rate` for '%s' throttle" %
self.__class__.__name__)
raise exceptions.ConfigurationError(msg)
@@ -133,11 +133,11 @@ class SimpleRateThottle(BaseThrottle):
return remaining_duration / float(available_requests)
-class AnonRateThrottle(SimpleRateThottle):
+class AnonRateThrottle(SimpleRateThrottle):
"""
Limits the rate of API calls that may be made by a anonymous users.
- The IP address of the request will be used as the unqiue cache key.
+ The IP address of the request will be used as the unique cache key.
"""
scope = 'anon'
@@ -153,7 +153,7 @@ class AnonRateThrottle(SimpleRateThottle):
}
-class UserRateThrottle(SimpleRateThottle):
+class UserRateThrottle(SimpleRateThrottle):
"""
Limits the rate of API calls that may be made by a given user.
@@ -175,7 +175,7 @@ class UserRateThrottle(SimpleRateThottle):
}
-class ScopedRateThrottle(SimpleRateThottle):
+class ScopedRateThrottle(SimpleRateThrottle):
"""
Limits the rate of API calls by different amounts for various parts of
the API. Any view that has the `throttle_scope` property set will be