code: def threads_bt(self):
          
          import threading
          import traceback
  
          threads = {}
          for thread in threading.enumerate():
              frames = sys._current_frames().get(thread.ident)
              if frames:
                  stack = traceback.format_stack(frames)
              else:
                  stack = []
              threads[thread] = "".join(stack)
          return flask.render_template("gourde/threads.html", threads=threads)
docs: Display thread backtraces.