I'm trying to limit the number of requests from an IP in case I get too many requests from it.
For example: if I will get more than 50 requests per minute I want to block that
IP for 5 minutes.
When I use request.META['REMOTE_ADDR']
I always get the IP of the local host and not the one that sent the request.
- How can I get the IP of the computer that sent the request?
- How can I limit that IP to not send more requests for X time?
Copyright Notice:Content Author:「brad」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/29321224/django-limit-the-number-of-requests-per-minute