Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Possible Problem Throttle#9706

Unanswered
williank asked this question inPotential Issue
Discussion options

The text in the documentation suggests that we can use the attributethrottle_classes=[UserRateThrottle] In the decorator@action, however, this does not seem to be true. Because the action decorator does not recognize thethrottle_classes.

I tested countless ways until I came to this conclusion.

https://www.django-rest-framework.org/api-guide/throttling/

It's also possible to set throttle classes for routes that are created using the@action decorator. Throttle classes set in this way will override any viewset level class settings.

@action(detail=True,methods=["post"],throttle_classes=[UserRateThrottle])defexample_adhoc_method(request,pk=None):content= {'status':'request was permitted'   }returnResponse(content)
You must be logged in to vote

Replies: 0 comments

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Labels
None yet
1 participant
@williank

[8]ページ先頭

©2009-2025 Movatter.jp