-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rate Throttling #421
Rate Throttling #421
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,6 +44,7 @@ | |
|
||
INSTALLED_APPS = [ | ||
"rest_framework", | ||
"rest_framework.authtoken", | ||
"django.contrib.admin", | ||
"django.contrib.auth", | ||
"django.contrib.contenttypes", | ||
|
@@ -97,7 +98,15 @@ | |
"PASSWORD": DATABASE_PASSWORD, | ||
"HOST": DATABASE_HOST, | ||
"PORT": DATABASE_PORT, | ||
} | ||
}, | ||
"test": { | ||
"ENGINE": "django.db.backends.postgresql", | ||
"NAME": "test_" + DATABASE_NAME, | ||
"USER": DATABASE_USER, | ||
"PASSWORD": DATABASE_PASSWORD, | ||
"HOST": DATABASE_HOST, | ||
"PORT": DATABASE_PORT, | ||
}, | ||
} | ||
Comment on lines
+101
to
110
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would say for now, we do not need to explicitly create a test database, since Django does that by default. Here are the paragraphs from the docs:
We might start with the TEST key inside the database. But we will address that in the issue #432. |
||
|
||
|
||
|
@@ -146,6 +155,11 @@ | |
SECRET_KEY = get_random_secret_key() | ||
|
||
REST_FRAMEWORK = { | ||
"DEFAULT_THROTTLE_CLASSES": [ | ||
"rest_framework.throttling.AnonRateThrottle", | ||
"rest_framework.throttling.UserRateThrottle", | ||
], | ||
"DEFAULT_THROTTLE_RATES": {"anon": "7/min", "user": "10/min"}, | ||
"DEFAULT_SCHEMA_CLASS": "drf_spectacular.openapi.AutoSchema", | ||
"DEFAULT_PAGINATION_CLASS": "rest_framework.pagination.PageNumberPagination", | ||
"PAGE_SIZE": 20, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this for user-based throttling? I think we can get rid of the authtoken and address this in a seperate issue.