title: How do I send empty response in Django without templates
body: <p>I have written a view which responds to ajax requests from browser. It's written like so - </p>
  
  <pre><code>@login_required
  def no_response(request):
      params = request.has_key("params")
      if params:
          # do processing
          var = RequestContext(request, {vars})
          return render_to_response('some_template.html', var)
      else: #some error
          # I want to send an empty string so that the 
          # client-side javascript can display some error string. 
          return render_to_response("") #this throws an error without a template.
  </code></pre>
  
  <p>How do i do it?</p>
  
  <p>Here's how I handle the server response on client-side - </p>
  
  <pre><code>    $.ajax
      ({
          type     : "GET",
          url      : url_sr,
          dataType : "html",
          cache    : false,
          success  : function(response)
          {
              if(response)
                  $("#resp").html(response);
              else
                  $("#resp").html("&lt;div id='no'&gt;No data&lt;/div&gt;");
          }
      });
  </code></pre>