code: def render_widget(self, request, widget_id):
          '''Returns rendered widget in JSON response'''
  
          widget = get_widget_from_id(widget_id)
  
          response = widget.render(**{'request': request})
  
          return JsonResponse({'result': response, 'id': widget_id}f render_widget(self, request, widget_id):
          '''Returns rendered widget in JSON response'''
  
          widget = get_widget_from_id(widget_id)
  
          response = widget.render(**{'request': request})
  
          return JsonResponse({'result': response, 'id': widget_id})
docs: Returns rendered widget in JSON response