Login

Tag "limit"

Snippet List

Limit the output of a field

This is a really simple snippet , but is not documented well ... Whit this , you can limit the output of one field in 25 characters before you test that is equal or over 30 characters! Note that the snippet cut the text and add three points at the end (...) Enjoy!

  • form
  • field
  • output
  • limit
Read More

Decorator to limit request rates to individual views

Example: @limit("global", 3, 10, per_ip=True) def view(request, ...): The example limits the view to one request every 3 seconds per ip address. The limit is shared by every view that uses the string "global" (first parameter), which is an arbitrary string. Request succeed until the accumulated requested time in seconds (second parameter) exceeds the limit (third parameter).

  • request
  • rate
  • limit
Read More

3 snippets posted so far.