1
Good Morning I checked user sessions through login and logout: In the login before logging it makes an Insert in my table:
cursor.execute("INSERT INTO usuarios_sessoes (usuario, datahorainicio) VALUES ('%s', '%s')" % (str(username),timezone.now().strftime('%d/%m/%Y %H:%M:%S')))
and at logout update:
  cursor.execute("""select id
                  from usuarios_sessoes
                  where usuario='"""+str(request.user)+"""'
                  order by datahorainicio desc limit 1""")
    id = cursor.fetchone()[0]  
With this I have my control of sessions, but what I need is that a superuser, can deploy any user, I could not find a solution to this.