简体   繁体   中英

How do I check if a 'different' user is logged in in django?

Every where I look for 'checking if user is logged in' directs me to checking if the currently logged in user is logged in. If I have a list of friends, and I want to see who in that list is logged in. How can I check that?

I've tried 'user.is_authenticated()' on the friends, but it always comes back as 'True'??

You can get this data from sessions table.

Check this question How to get the list of the authenticated users?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM