From c4b2d52682d533b1af24be62b59534b5637f0b5f Mon Sep 17 00:00:00 2001 From: Paul Hallett Date: Wed, 6 Jul 2016 14:04:09 +0100 Subject: [PATCH] Add throttle settings (#223) * Add throttle settings Proposed API rate limit throttling. This should work directly with redis. * Update settings.py --- config/settings.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/config/settings.py b/config/settings.py index 4db4af0f..cedf603b 100755 --- a/config/settings.py +++ b/config/settings.py @@ -160,6 +160,12 @@ REST_FRAMEWORK = { 'PAGE_SIZE': 20, 'PAGINATE_BY': 20, + 'DEFAULT_THROTTLE_CLASSES': ( + 'rest_framework.throttling.AnonRateThrottle', + ), + 'DEFAULT_THROTTLE_RATES': { + 'anon': '1000/hour' + } } MARKDOWN_DEUX_STYLES = {