This commit is contained in:
Reza Shalbaf Zadeh 2017-06-07 14:43:10 +00:00 committed by GitHub
commit e0b220aa50

View File

@ -187,6 +187,7 @@ The following is an example of a rate throttle, that will randomly throttle 1 in
import random
class RandomRateThrottle(throttling.BaseThrottle):
import random
def allow_request(self, request, view):
return random.randint(1, 10) != 1