Rate limiting for django applications
djlimiter provides rate limiting features to django via a middleware.
Add the rate limiter to your django projects’ settings.py and enable a global rate limit for all views in your project:
MIDDLEWARE_CLASSES += ("djlimiter.Limiter",) RATELIMIT_GLOBAL = "10/second"
If you only want to enable rate limits to certain endpoints, leave out the RATELIMIT_GLOBAL setting and use the decorator approach instead in the respective view function:
@limit("10/second") def index(request): ...
For detailed documentation visit Read the docs
- Django 1.8/1.9 compatibility
- Bug Fix: remove duplicate hits when rate limits are stacked.
- Bug Fix: multiple rate limits returned by dynamic limits weren’t respected.
- Documentation tweaks.
- first release.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.