mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-12-04 23:44:07 +03:00
Tweak copy in throttling docs
This commit is contained in:
parent
24d0f24527
commit
11452758bf
|
@ -198,7 +198,7 @@ class UploadView(APIView):
|
||||||
</code></pre>
|
</code></pre>
|
||||||
<p>User requests to either <code>ContactListView</code> or <code>ContactDetailView</code> would be restricted to a total of 1000 requests per-day. User requests to <code>UploadView</code> would be restricted to 20 requests per day.</p>
|
<p>User requests to either <code>ContactListView</code> or <code>ContactDetailView</code> would be restricted to a total of 1000 requests per-day. User requests to <code>UploadView</code> would be restricted to 20 requests per day.</p>
|
||||||
<h2 id="custom-throttles">Custom throttles</h2>
|
<h2 id="custom-throttles">Custom throttles</h2>
|
||||||
<p>To implement a custom throttle, override <code>BaseThrottle</code> and implement <code>.allow_request(request)</code>. The method should return <code>True</code> if the request should be allowed, and <code>False</code> otherwise.</p>
|
<p>To create a custom throttle, override <code>BaseThrottle</code> and implement <code>.allow_request(request)</code>. The method should return <code>True</code> if the request should be allowed, and <code>False</code> otherwise.</p>
|
||||||
<p>Optionally you may also override the <code>.wait()</code> method. If implemented, <code>.wait()</code> should return a recomended number of seconds to wait before attempting the next request, or <code>None</code>. The <code>.wait()</code> method will only be called if <code>.check_throttle()</code> has previously returned <code>False</code>.</p>
|
<p>Optionally you may also override the <code>.wait()</code> method. If implemented, <code>.wait()</code> should return a recomended number of seconds to wait before attempting the next request, or <code>None</code>. The <code>.wait()</code> method will only be called if <code>.check_throttle()</code> has previously returned <code>False</code>.</p>
|
||||||
</div><!--/span-->
|
</div><!--/span-->
|
||||||
</div><!--/row-->
|
</div><!--/row-->
|
||||||
|
|
Loading…
Reference in New Issue
Block a user