monitor api request count
Project description
Django-request-counter
Install this app to get request count of all the api
Installation
Install my-project with pip
pip install request-counter
In settings.py add below Add the app in installed apps
INSTALLED_APPS = [
...
"request_counter",
]
Add middleware
MIDDLEWARE = [
...
"request_counter.middlewares.APICounterMiddleware",
]
To check using API Add
urlpartterns = [
...
path("",include("request_counter.urls")),
]
Set Redis Url
# REDIS_URL = "redis://localhost:6379/7"
REDIS_URL = "<your redis url path>"
You need to setup cron to periodically save the data into database by by default it store data into database
python manage.py store_api_count
Now make api request with admin user
curl --location '<base-url>/api-count' \
--header '<your authentication header>'
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
request-counter-1.1.0.tar.gz
(3.6 kB
view hashes)
Built Distribution
Close
Hashes for request_counter-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 93b2e8bbb1bd5a7d47b2e9a8cab9a0fb13056ea178dc2e2e0c65f095a2073d12 |
|
MD5 | f891032fc55d2fb58e1c7a536b66e4ab |
|
BLAKE2b-256 | 635b9ac47c5333fdc8a8c5bf003e06415b74340e79f9d107f8fc420c901a5407 |