mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-04 12:30:11 +03:00
Merge 564675e62f
into 836e49b535
This commit is contained in:
commit
e0b220aa50
|
@ -187,6 +187,7 @@ The following is an example of a rate throttle, that will randomly throttle 1 in
|
||||||
import random
|
import random
|
||||||
|
|
||||||
class RandomRateThrottle(throttling.BaseThrottle):
|
class RandomRateThrottle(throttling.BaseThrottle):
|
||||||
|
import random
|
||||||
def allow_request(self, request, view):
|
def allow_request(self, request, view):
|
||||||
return random.randint(1, 10) != 1
|
return random.randint(1, 10) != 1
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user