What are the best practices in Django to detect and prevent DoS attacks... Are there any ready to use apps or middleware available which prevents website access and scan through bots?
You might want to read the following 3 questions over on Security Stack Exchange.
A quick description of the problem:
Possible solutions and limitations of attempting mitigation in software:
And a bit of discussion around commonly used anti-DDoS techniques at the perimeter, rather than the application:
It is really difficult to do at the application level - the earlier in the path you can drop the attack, the better.