code: def render_to_json(templates, context, request):
      
      html = render_to_string(
          templates,
          context=context,
          request=request
      )
      _json = json.dumps({
          "html": html
      })
      return HttpResponse(_json)
docs: Generate a JSON HttpResponse with rendered template HTML.