Added Throttle to django rest api

This commit is contained in:
z0ccc 2021-08-29 14:21:29 -04:00
parent c20af24293
commit 839d9e20f2

View file

@ -106,6 +106,14 @@ REST_FRAMEWORK = {
'DEFAULT_RENDERER_CLASSES': [
'rest_framework.renderers.JSONRenderer',
],
'DEFAULT_THROTTLE_CLASSES': [
'rest_framework.throttling.AnonRateThrottle',
'rest_framework.throttling.UserRateThrottle'
],
'DEFAULT_THROTTLE_RATES': {
'anon': '100/day',
'user': '1000/day'
}
}
# Internationalization