Add a basic rate limit

This commit is contained in:
Jake Howard 2022-08-23 08:43:58 +01:00
parent 67095752d2
commit 4a82d1262d
Signed by: jake
GPG key ID: 57AFB45680EDD477

View file

@ -211,3 +211,15 @@ if DEBUG:
SWAGGER_SETTINGS = {"USE_SESSION_AUTH": False, "SECURITY_DEFINITIONS": {}} SWAGGER_SETTINGS = {"USE_SESSION_AUTH": False, "SECURITY_DEFINITIONS": {}}
REST_FRAMEWORK = {
"DEFAULT_THROTTLE_CLASSES": [
"rest_framework.throttling.AnonRateThrottle",
],
"DEFAULT_THROTTLE_RATES": {
"anon": "10/min",
},
"DEFAULT_AUTHENTICATION_CLASSES": [
"rest_framework.authentication.SessionAuthentication",
],
}