11.9.drf的throttle设置api的访问速率
The default throttling policy may be set globally, using the DEFAULT_THROTTLE_CLASSES
and DEFAULT_THROTTLE_RATES
settings. For example.
The rate descriptions used in DEFAULT_THROTTLE_RATES
may include second
, minute
, hour
or day
as the throttle period.
You can also set the throttling policy on a per-view or per-viewset basis, using the APIView
class-based views.
Or, if you're using the @api_view
decorator with function based views.
Last updated
Was this helpful?