From febaa4db00c322d169a5e60ecd22c909e8a836c2 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Mon, 8 Aug 2016 09:28:15 +0100 Subject: [PATCH] Add import in docs. [ci skip] --- docs/api-guide/throttling.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/api-guide/throttling.md b/docs/api-guide/throttling.md index 4eef4fd5d..51d2beef1 100644 --- a/docs/api-guide/throttling.md +++ b/docs/api-guide/throttling.md @@ -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