drf的throttle设置api的访问速率

drf的throttle设置api的访问速率,在setting中设置,登录用户和匿名用户的请求频率做限制,限制单位天、时、分等都可以

在views中:

from rest_framework.throttling import UserRateThrottle,AnonRateThrottle

视图类中

throttle_class = (UserRateThrottle,AnonRateThrottle)

原文地址:https://www.cnblogs.com/maxiaohei/p/7820230.html