docs: def setup(self, app):
          """Setup the plugin and prepare application."""
          super(Plugin, self).setup(app)
  
          if 'jinja2' not in app.plugins:
              raise PluginException('The plugin requires Muffin-Jinja2 plugin installed.')
  
          self.cfg.prefix = self.cfg.prefix.rstrip('/') + '/'
          self.cfg.exclude.append(self.cfg.prefix)
  
          # Setup debugtoolbar templates
          app.ps.jinja2.cfg.template_folders.append(op.join(PLUGIN_ROOT, 'templates'))
  
          self.cfg.panels += list(self.cfg.additional_panels)
          panels_ = []
          for panel in self.cfg.panels:
              if isinstance(panel, str):
                  mod, _, panel = panel.partition(':')
                  mod = importlib.import_module(mod)
                  panel = eval(panel or 'DebugPanel', mod.__dict__)
              panels_.append(panel)
          self.cfg.panels = panels_
  
          # Setup debugtoolbar static files
          app.router.register_route(StaticRoute(
              'debugtoolbar.static',
              self.cfg.prefix + 'static/',
              op.join(PLUGIN_ROOT, 'static')))
  
          app.register(self.cfg.prefix + 'sse', name='debugtoolbar.sse')(self.sse)
          app.register(
              self.cfg.prefix + 'exception', name='debugtoolbar.exception')(self.exception)
          app.register(
              self.cfg.prefix + 'execute', name='debugtoolbar.execute')(self.execute)
          app.register(
              self.cfg.prefix + 'source', name='debugtoolbar.source')(self.source)
          app.register(
              self.cfg.prefix.rstrip('/'),
              self.cfg.prefix,
              self.cfg.prefix + '{request_id}', name='debugtoolbar.request')(self.view)
  
          app['debugtoolbar'] = {}
          app['debugtoolbar']['pdbt_token'] = uuid.uuid4().hex
          self.history = app['debugtoolbar']['history'] = utils.History(50)
          self.exceptions = app['debugtoolbar']['exceptions'] = utils.History(50)
          self.frames = app['debugtoolbar']['frames'] = utils.History(100)