From 122938a8b53fa2c7e8e37246621eb846c4c04eb9 Mon Sep 17 00:00:00 2001 From: Keannu Bernasol Date: Wed, 6 Sep 2023 20:41:15 +0800 Subject: [PATCH] Added throttling rates --- stude/config/settings.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/stude/config/settings.py b/stude/config/settings.py index 450d3f2..07721d2 100644 --- a/stude/config/settings.py +++ b/stude/config/settings.py @@ -141,6 +141,21 @@ REST_FRAMEWORK = { 'DEFAULT_AUTHENTICATION_CLASSES': ( 'rest_framework_simplejwt.authentication.JWTAuthentication', ), + 'DEFAULT_THROTTLE_CLASSES': [ + + 'rest_framework.throttling.AnonRateThrottle', + + 'rest_framework.throttling.UserRateThrottle' + + ], + + 'DEFAULT_THROTTLE_RATES': { + + 'anon': '360/min', + + 'user': '1440/min' + + }, 'DEFAULT_SCHEMA_CLASS': 'drf_spectacular.openapi.AutoSchema', }