code: def json_rpc_format(self):
          
  
          error = {
              'name': smart_text(self.__class__.__name__),
              'code': self.code,
              'message': "%s: %s" %
              (smart_text(self.__class__.__name__), smart_text(self.message)),
              'data': self.data
          }
  
          from django.conf import settings
  
          if settings.DEBUG:
              import sys, traceback
              error['stack'] = traceback.format_exc()
              error['executable'] = sys.executable
  
          return error
docs: return the Exception data in a format for JSON-RPC