django视图的节流系统。
throttling的Python项目详细描述
django视图的节流系统。
基本用法
添加到设置
INSTALLED_APPS = ( ... 'throttling', )
在您看来
from throttling.decorators import throttle @throttle(1000) def view(request): return HttpResponse('success')
功能
- 每个匿名用户
- 每个用户(匿名或经过身份验证)
- 具有特定用户角色的每个经过身份验证的用户
- 向组中呼叫的每个经过身份验证的用户
限制每个视图或一组视图的最大请求数< /d> -
dt>限制每个视图或一组视图的共享最大请求数< /d>
- 所有匿名用户
- 所有用户(匿名或经过身份验证)
- 向组发送消息的所有经过身份验证的用户