Question: Is their any way of counting number of django logins?
The last\_login field of the auth\_user gets updated with each login.
Can we make use of that field to count number of logins by a specific user?

Answer: 
There's also a 'user\_logged\_in' signal that'll do the trick with out the need to check for last logins etc.

```
class UserLogin(models.Model):
    """Represent users' logins, one per record"""
    user = models.ForeignKey(user) 
    timestamp = models.DateTimeField()

from django.contrib.auth.signals import user_logged_in

def update_user_login(sender, user, **kwargs):
    user.userlogin_set.create(timestamp=timezone.now())
    user.save()

user_logged_in.connect(update_user_login)

```
You can use [django-timeStamps](https://github.com/zandegran/django-timeStamp) to store rcent login times. A simple light weight tool.