I am new to DRF and I am supposed to create few endpoints for only displaying simple statistics data.
What I want:
I want to create simple aggregation endpoint using DRF views, or by any convenient DRF manner.
First endpoint /users/total :
{
"total_users": 5534
}
Second endpoint /users/2009/january:
{
"new_users": 12,
"disabled_users": 2,
"new_premium_users": 6,
}
Problem:
Looks like the most of the DRF API views are intended to be working good when supplying a list of models, or displaying/manipulating data of single model.
Is there any convenient how to handle simple aggregation endpoints? Any insights appreciated.