Add import in docs. [ci skip]

This commit is contained in:
Tom Christie 2016-08-08 09:28:15 +01:00
parent e7eccac6df
commit febaa4db00

View File

@ -184,6 +184,8 @@ If the `.wait()` method is implemented and the request is throttled, then a `Ret
The following is an example of a rate throttle, that will randomly throttle 1 in every 10 requests.
import random
class RandomRateThrottle(throttling.BaseThrottle):
def allow_request(self, request, view):
return random.randint(1, 10) == 1