All you can do are social engineering hacks. There's no way for the web
protocol to know and Django doesn't ship with anything like that (since
it's an arms race -- what works one day in one scenario doesn't work in
other places). You have no way of knowing if submissions from the same
IP address are from a bot or a human, so you just have to decide whether
to allow those or now. Since major bot attacks rarely come from single
IP addresses in any case, it's only a first line of defence (really
major attacks are done in distributed form, so they come from multiple
locations -- but often isn't an issue for normal sites, since you're
miles below the radar for such attackers).
Rate limit throttling is one fairly easy way to keep things in line.
Maximum number per minute on average (keeping a running moving average
value is easy) and maximum number per day, for example.
>
> Are there some algorithms in Django to cope with this kind of
> situations?
No, for the reason mentioned above.
> Maybe passing some kind of key protection in the URL?
Anything automatic isn't going to stop a bot, any more than a human.
That's why the effective prevention measures are something unpredictable
that a human has to do -- from a CAPTCHA style entry to just entering
the word "orange" in a box to solving a mathematics problem.
Regards,
Malcolm