title: How to track a user time between login and logout activity i.e. to track that how much time he/she spend between login and logout
body: <p>I am working on a task. To build a middleware using Django rest framework that can track the user time from the moment he/she logins and do some activity and then logout. I have to track the time he/she spends between login and logout using middleware. Please suggest some proper procedures to complete the task. I am new to django and restframework.</p>