Skip to content

Commit

Permalink
Merge pull request #1903 from dandi/fix-rate-limiting
Browse files Browse the repository at this point in the history
Add missing setting for DRF throttle class
  • Loading branch information
waxlamp authored Mar 22, 2024
2 parents c3666bc + c221d7a commit 0a3524d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dandiapi/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
}
Expand Down

0 comments on commit 0a3524d

Please sign in to comment.