code: def render_region(self, request):
          '''Returns rendered region in JSON response'''
  
          page = self.get_object()
  
          try:
              region = request.POST['region']
          except KeyError:
              region = request.GET['region']
  
          request.query_string = None
  
          from leonardo.utils.widgets import render_region
  
          result = render_region(page=page, request=request, region=region)
  
          return JsonResponse({'result': result, 'region': region}f render_region(self, request):
          '''Returns rendered region in JSON response'''
  
          page = self.get_object()
  
          try:
              region = request.POST['region']
          except KeyError:
              region = request.GET['region']
  
          request.query_string = None
  
          from leonardo.utils.widgets import render_region
  
          result = render_region(page=page, request=request, region=region)
  
          return JsonResponse({'result': result, 'region': region})
docs: Returns rendered region in JSON response