jedie / django-tools

miscellaneous django tools
http://pypi.python.org/pypi/django-tools/
Other
129 stars 31 forks source link

add throttle feature... #2

Open jedie opened 12 years ago

jedie commented 12 years ago

In PyLucid i have a simple ban function. The Principe is simple: I add logging entries and if in a defined time too many entries, the IP address would be added to the ban model. This model would be used in the middleware to ban…

Models:

middleware:

A better idea is to use the cache, like the throttle decorator in django-piston: https://bitbucket.org/jespern/django-piston/src/7c90898072ce/piston/utils.py#cl-108