from django.contrib.sessions.models import Session
from django.contrib.auth.models import User
def close_session(login):
user = User.objects.get(username=login)
for session in Session.objects.all():
uid = session.get_decoded().get('_auth_user_id')
if uid == user.pk:
session.delete()
Комментариев нет:
Отправить комментарий