Django Rate Limiter
- Tested on: Python 3.11.5
- Django 5.2.12
Start by installing the package:
pip install django-api-rate-limiter
Then add in your settings.py
INSTALLED_APPS = [
# rest of the apps..
'django_api_rate_limiter'
]
# you will need to configure the default cache to point to Redis
CACHES = {
"default": {
"BACKEND": "django_redis.cache.RedisCache",
"LOCATION": "redis://127.0.0.1:6379/1",
"OPTIONS": {
"CLIENT_CLASS": "django_redis.client.DefaultClient",
}
}
}
Navigate to your /admin page and visit section "Admin_Limiter"->"Api limiters".
There you can set up your own limits specified in "values per second". For example, you can fill up as:
| Speed Value | 10 |
| Method | Get |
| Url | /api/limited |
This translates to: For every anonymous & logged in user apply the limit of 10 requests per second for GET requests going to /api/limited
If your project is using django-oauth-toolkit, you can specify per-user limits, which are linked to the oauth tokens issued to users
Please install OpenResty if you would like to use the Lua files from "nginx_lua" folder
You can find example & detailed explanation at https://decodeapps.pp.ua/blog/post/how-to-build-dynamic-nginx-rate-limiting-with-django-admin-redis
Metadata
Release files for django-api-rate-limiter 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| django_api_rate_limiter-0.0.5.tar.gz | 68.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| django_api_rate_limiter-0.0.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 75.0 kB
Release files / django_api_rate_limiter-0.0.5.tar.gz
| Download URL | django_api_rate_limiter-0.0.5.tar.gz |
|---|---|
| Size | 68.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d705ae7868a7803801620fede795a34900630b84917468c315fba625fecd4c5f
|
|
BLAKE2b-256 checksum How to use checksums |
020e3482f308193f4b59c2c80ab61bc6f1169a773530f9ac239b528dc0935547
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 16, 2026.
Transparency logRelease files / django_api_rate_limiter-0.0.5-py3-none-any.whl
| Download URL | django_api_rate_limiter-0.0.5-py3-none-any.whl |
|---|---|
| Size | 6.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8f81aa96a4ffbf0638f61a64655949d301874f2ddf360f84baafe0f3c3edfb21
|
|
BLAKE2b-256 checksum How to use checksums |
d02c75b7d8b88c09acabd7aa844fe2f38530ccb3e05f65293a42de8fee066092
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 16, 2026.
Transparency log