Async-ready, fault-tolerant rate limiting for Django.
Project details
Most Django rate limiting solutions are sync-first and cache-only. Django Smart Ratelimit is a stateless, production-focused alternative with modern algorithms (Token Bucket / Sliding Window), Redis & async-friendly backends, and a built-in circuit breaker for safer behavior under load and backend failures.
Django Smart Ratelimit is a powerful and efficient rate limiting library designed specifically for Django applications. This high-performance, stateless solution effectively safeguards APIs against abusive traffic while optimizing performance across distributed systems through atomic Redis operations and implementing circuit-breaking strategies.
To demonstrate its ease of use, here’s a quick implementation example:
from django_smart_ratelimit import ratelimit
@ratelimit(key='ip', rate='5/m', block=True)
def login_view(request):
# If the limit is exceeded, this code receives a 429 Too Many Requests
return authenticate(request)
For comprehensive guidance, refer to the complete documentation organized in the docs/ folder, covering topics such as:
Engagement is encouraged through GitHub Discussions for idea sharing and Q&A, as well as the Issues section for reporting potential bugs.
Comments
0Start the conversation
Share the first comment.