root: add global fallback throttle

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2022-10-15 23:51:36 +02:00
parent a3cc844e25
commit 2112b5b26b
2 changed files with 5 additions and 0 deletions

View File

@ -55,6 +55,7 @@ throttle:
providers: providers:
oauth2: oauth2:
device: 20/hour device: 20/hour
default: 1000/second
outposts: outposts:
# Placeholders: # Placeholders:

View File

@ -174,6 +174,10 @@ REST_FRAMEWORK = {
], ],
"DEFAULT_SCHEMA_CLASS": "drf_spectacular.openapi.AutoSchema", "DEFAULT_SCHEMA_CLASS": "drf_spectacular.openapi.AutoSchema",
"TEST_REQUEST_DEFAULT_FORMAT": "json", "TEST_REQUEST_DEFAULT_FORMAT": "json",
"DEFAULT_THROTTLE_CLASSES": ["rest_framework.throttling.AnonRateThrottle"],
"DEFAULT_THROTTLE_RATES": {
"anon": CONFIG.y("throttle.default"),
},
} }
REDIS_PROTOCOL_PREFIX = "redis://" REDIS_PROTOCOL_PREFIX = "redis://"