2

I want to keep track of url hit count daily in a db and was wondering what would be the best tool do so? I'm running nginx, django, and django rest framework.

edit: the main goal is not only to track a given url but the parameters passed in. I have an object building and an object person. People belong to a building. You pass in a building id (GET using url) and receive all the people for that building. I'm wanting to be able to see total url calls to buildings and get a count for each particular building.

user2812463
  • 265
  • 5
  • 14
  • Why not let that to an analytics engine instead of Django? – petkostas Apr 01 '15 at 16:54
  • I want to be able to track routes and the attributes passed in these routes. I think with web analytics you'll get urls but not the variables? I think I left that out the original question so I'll add that in. – user2812463 Apr 01 '15 at 18:04
  • Hey OP, did you figure out an answer to this? Thanks. – pyramidface Aug 03 '15 at 10:27
  • @pyramidface I ended up using http://stackoverflow.com/questions/15578946/logging-requests-to-django-rest-framework/27928365#27928365 as middleware and I'm logging the results to a log file. – user2812463 Aug 10 '15 at 15:33

2 Answers2

1

One tool I've found is drf-tracking. Seems to track what you want through the addition of a simple mixin on your view.

mlissner
  • 17,359
  • 18
  • 106
  • 169
  • drf-tracking I think is a great candidate but at the time of this writing it has gone stale with little activity from the repo owner to keep it up date. – avelis Nov 09 '16 at 22:01
0

You can use Google Analytics to keep track on the number of clicks/users per day.

Otherwise if you are looking for a Django specific plugin/app, you can try using django-analytics

Siddharth Gupta
  • 1,573
  • 9
  • 24