A flexible and efficient rate limiting library for Django applications
Project description
Django Smart Ratelimit
The checkmate for abusive traffic.
A high-performance, stateless rate limiting library for Django that protects your API from abuse, optimized for distributed systems with atomic Redis operations and circuit breaking.
Sponsors
Support the ongoing development of Django Smart Ratelimit!
Become a sponsor to see your logo here!
Key Features
- 🚀 Stateless & Modern: Dual-mode support (Sync/Async) without database dependencies.
- 🛡️ Enterprise Reliability: Built-in Circuit Breaker and Automatic Failover strategies.
- ⚡ Multiple Algorithms: Choose between Token Bucket, Sliding Window, and Fixed Window.
- 🔌 Flexible Backends: Redis (recommended), Async Redis, Memory, or Custom backends.
- 🎯 Precise Control: Rate limit by IP, User, Header, or any custom callable.
Quick Start
Installation
pip install django-smart-ratelimit[redis]
Usage in 30 Seconds
from django_smart_ratelimit import ratelimit
@ratelimit(key='ip', rate='5/m', block=True)
def login_view(request):
# If limit is exceeded, this code receives a 429 Too Many Requests
return authenticate(request)
Documentation
We have moved our detailed documentation to the dedicated docs/ folder:
| Topic | Description |
|---|---|
| 📚 Full Documentation | Start here for the complete guide. |
| 🚀 Migration Guide | Upgrading from django-ratelimit? clear steps here. |
| 🧮 Algorithms | Deep dive into Token Buckets and Windows. |
| ⚙️ Configuration | Advanced settings, Backends, and Circuit Breakers. |
| 🔍 Design Philosophy | Why we built this and how it compares to others. |
Contributing
We welcome contributions! Please see CONTRIBUTING.md for details on how to submit pull requests, report issues, and setup your development environment.
Community & Support
- GitHub Discussions: Ask questions and share ideas.
- Issues: Report bugs.
- AI Usage Policy: Our transparency commitment.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_smart_ratelimit-1.0.3.tar.gz.
File metadata
- Download URL: django_smart_ratelimit-1.0.3.tar.gz
- Upload date:
- Size: 208.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dd0ad1cc1f7d87baa434126970a97ed8f40ebfef68a989eba3a23c0b82608a86
|
|
| MD5 |
1ab3c707cb91d95e49dbd7e75014f041
|
|
| BLAKE2b-256 |
38b7d51ef4fedf1c9d32e39f1c348a82c9849bd0db2a1212630d4d1c1231c911
|
File details
Details for the file django_smart_ratelimit-1.0.3-py3-none-any.whl.
File metadata
- Download URL: django_smart_ratelimit-1.0.3-py3-none-any.whl
- Upload date:
- Size: 97.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07784faf4043be1c35126f9794e16667501fe90729692a2681ef5ff760b1c73e
|
|
| MD5 |
07361653e60785c83df3a625e8929241
|
|
| BLAKE2b-256 |
31fc7f352285edc71db0f262eca08cc62d6165b1f2cb356a98d212e9843331bc
|