From 564675e62f43f38e549bbdb23e1c0dba3d62b657 Mon Sep 17 00:00:00 2001 From: Reza Shalbaf Zadeh Date: Sat, 6 Aug 2016 18:08:55 +0430 Subject: [PATCH] Update documentation example won't work without importing random module --- docs/api-guide/throttling.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/api-guide/throttling.md b/docs/api-guide/throttling.md index 4eef4fd5d..204fd2759 100644 --- a/docs/api-guide/throttling.md +++ b/docs/api-guide/throttling.md @@ -185,6 +185,7 @@ 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. class RandomRateThrottle(throttling.BaseThrottle): + import random def allow_request(self, request, view): return random.randint(1, 10) == 1