Hi everyone!
I’m excited to share django-smart-ratelimit v0.3.2—a lightweight, context-aware rate-limiting library for Django apps.
Key features:
Per-view, per-user (or API key) and global limits
Blazing speed via atomic Redis Lua scripts
Fixed-window & sliding-window algorithms
Pluggable backends: Redis, database, in-memory
Decorator + middleware APIs
Standard RateLimit headers (Limit/Remaining/Reset)
Getting started is easy:
pip install django-smart-ratelimit
from smart_ratelimit.decorators import ratelimit
@ratelimit(key='user', rate='100/h', block=True)
def my_view(request):
return HttpResponse("Hello, rate-limited Django!")
PyPI: https://pypi.org/project/django-smart-ratelimit/
GitHub & full roadmap: https://github.com/YasserShkeir/django-smart-ratelimit
I’d love to hear:
- Your use cases or integration tips
- Any issues you encounter or features you’d like to see
- Performance feedback in real-world workloads
Thanks for checking it out—looking forward to your thoughts and contributions!
— Yasser Shkeir