Hello There is a project in which I would not want to allow users to open new tabs in other browsers and reauthorize on a resource. Those. A user should be logged in only from one tab. Is there any way to get all logged in users in Django at the current time? In order to do something like this:

all_login_users = ΠŸΠΎΠ»ΡƒΡ‡ΠΈΡ‚ΡŒ список Π·Π°Π»ΠΎΠ³ΠΈΠ½Π΅Π½Ρ‹Ρ… ΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚Π΅Π»Π΅ΠΉ Π½Π° Ρ‚Π΅ΠΊΡƒΡ‰ΠΈΠΉ ΠΌΠΎΠΌΠ΅Π½Ρ‚. If user in all_login_users: # Если ΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚Π΅Π»ΡŒ Π΅ΡΡ‚ΡŒ Π² спискС user.logout() # Π²Ρ‹Ρ…ΠΎΠ΄ΠΈΠΌ ΠΈΠ· всСх Π²ΠΊΠ»Π°Π΄ΠΎΠΊ Π² ΠΊΠΎΡ‚ΠΎΡ€Ρ‹Ρ… ΠΌΡ‹ залогинились Ρ€Π°Π½ΡŒΡˆΠ΅ user.login() # логинимся ΠΏΠΎ Π½ΠΎΠ²ΠΎΠΉ. 

Maybe there are some other mechanisms for this implementation? Requires atomicity of user actions.

0