How to get users spent time on a task with Djanog?

164 Views Asked by At

I have Django project and several views. In one view i want to track users spent time. How can i do that? Maybe some libraries or django built in methods?

Little bit more about view:

when user open view he can see many photoes, and then he need to choose similar and save. Then page reloads with new photoes and task is similar, find similar photoes and submit.

I need to track and store that time what each user spent on this task.


If i check users time when he open view i don't know when she close it, and also user can just open view and chill, without doing something.


How or with i can realize it?

1

There are 1 best solutions below

0
On

Sorry wasn't able to comment but hope this helps:

  • Make use of Django sessions 'django.contrib.sessions to check the user session (start and stop)
  • Use JavaScript & jQuery to track the time spent and
  • also check mouse events/key events to make sure the user actually does something