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.
No comments yet.
Sign in to be the first to comment.