Skip to content

Commit

Permalink
Enable DRF API throttling
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmreed committed Sep 21, 2023
1 parent 54b26fd commit 56331b3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,15 @@ def safe_key() -> str:
"rest_framework.authentication.TokenAuthentication",
"rest_framework.authentication.SessionAuthentication",
),
'DEFAULT_THROTTLE_CLASSES': [
'rest_framework.throttling.AnonRateThrottle',
'rest_framework.throttling.UserRateThrottle'
],
'DEFAULT_THROTTLE_RATES': {
'anon': '4/sec',
'user': '4/sec'
}

}

# Token expiration
Expand Down
1 change: 1 addition & 0 deletions metadeploy/api/management/commands/populate_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ def create_eda(self, category):
title="Install",
tier=Plan.Tier.primary,
commit_ish="e785195d07a3ac9e395f27829866005dbdcd5bd0",
supported_orgs="Both"
)
PlanSlug.objects.create(parent=plan_template, slug="install")
steps = [
Expand Down

0 comments on commit 56331b3

Please sign in to comment.