if user.pk == session_data.get('_auth_user_id'):
    user_sessions.append(session.pk)
return Session.objects.filter(pk__in=user_sessions)
Most optimized way to delete all sessions for a specific user in Django?