How to avoid ajax request flooding in django
In django I made a simple ajax handler that will validate a POST request and on success write to a database -- which will later be available to be seen publicly. Anonymous in this case is allowed.
Much like StackOverFlow will accept questions posted by logged in and non logged in user, we'd have similar acceptance.
How do I deal with scripts/robots that continually feeds ajax requests to my URL for t开发者_开发知识库he purpose of spam/DOS?
There are several ways to do this. If you don't want to do it through the lower level (server, load balancer), 0 may be a good choice.
It can throttle anonymous requests on cookies / IP addresses. Just call your view through a handler, apply the appropriate decorator, and you should be all set.
精彩评论