class documentation
class AnonRateThrottle(SimpleRateThrottle): (source)
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 unique cache key.
Method | get |
Should return a unique cache-key which can be used for throttling. Must be overridden. |
Class Variable | scope |
Undocumented |
Inherited from SimpleRateThrottle
:
Method | __init__ |
Undocumented |
Method | allow |
Implement the check to see if the request should be throttled. |
Method | get |
Determine the string representation of the allowed request rate. |
Method | parse |
Given the request rate string, return a two tuple of: <allowed number of requests>, <period of time in seconds> |
Method | throttle |
Called when a request to the API has failed due to throttling. |
Method | throttle |
Inserts the current request's timestamp along with the key into the cache. |
Method | wait |
Returns the recommended next request time in seconds. |
Class Variable | cache |
Undocumented |
Instance Variable | duration |
Undocumented |
Instance Variable | history |
Undocumented |
Instance Variable | key |
Undocumented |
Instance Variable | now |
Undocumented |
Instance Variable | num |
Undocumented |
Instance Variable | rate |
Undocumented |
Inherited from BaseThrottle
(via SimpleRateThrottle
):
Method | get |
Identify the machine making the request by parsing HTTP_X_FORWARDED_FOR if present and number of proxies is > 0. If not use all of HTTP_X_FORWARDED_FOR if it is available, if not use REMOTE_ADDR. |