Django: Find Most Recently Logged in Users

by Rich Jones on Jun 7, 2012.

Tiny blog post!

Do you want to find the most recently logged in users in your Django application? Cool, no problem. You'll be filtering and sorting your most active users in no time.

Here's how you do it:

Then, to display the result,

And that's it! Handy little trick if you're trying to engage your active users with each other.


Learn and Earn!

Sign up for great tutorials, guides, rants, raves and opportunities to earn more money!