From c221d7a2f57f226aae07652a0a617785819c0ac3 Mon Sep 17 00:00:00 2001 From: Mike VanDenburgh Date: Fri, 22 Mar 2024 14:42:08 -0400 Subject: [PATCH] Add missing setting for DRF throttle class --- dandiapi/settings.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dandiapi/settings.py b/dandiapi/settings.py index 464618fd5..7ed9df4b7 100644 --- a/dandiapi/settings.py +++ b/dandiapi/settings.py @@ -188,6 +188,9 @@ def mutate_configuration(configuration: type[ComposedConfiguration]): configuration.INSTALLED_APPS.remove('composed_configuration.sentry.apps.SentryConfig') # In production, enable rate limiting for unauthenticated users + configuration.REST_FRAMEWORK['DEFAULT_THROTTLE_CLASSES'] = [ + 'rest_framework.throttling.AnonRateThrottle', + ] configuration.REST_FRAMEWORK['DEFAULT_THROTTLE_RATES'] = { 'anon': '300/minute', }