code: def debug(self):
          
          try:
              __import__('ipdb').post_mortem(self.traceback)
          except ImportError:
              __import__('pdb').post_mortem(self.traceback)
docs: Launch a postmortem debug shell at the site of the error.