How can I know if a specific user is logged in Django (not the currently requesting user)?
I tried this:
user = User.objects.get(username="jon")
if user.is_authenticated():
print "user logged"
But this always returns True if the username matched.
No in-built method exists to do what you’re looking for, however there is an app that you can plugin to your project that lets you do what you want. It’s called django-tracking and you can find it here: https://github.com/codekoala/django-tracking
EDIT Whoops! I got beat to it, but basically what Mark Lavin said.