title: How to solve "didn't return an HttpResponse object" error?
body: <p>I have a delete button. I use the same structure in other views and it is working correclty. But in this page it did not work. When I want to delete a comment there is an error:</p>
  <blockquote>
  <p>ValueError at /comment/18/analysis/ The view
  ocr.views.delete_approval_comment didn't return an HttpResponse
  object. It returned None instead.</p>
  </blockquote>
  <p>It deletes the comment but gives this error. How can I solve it?</p>
  <p><strong>views.py</strong></p>
  <pre><code>def delete_approval_comment(request,id):
      comment = CommentFromOthers.objects.get(id=id)
      comment.delete()
      redirect('ocr', comment.doc_id.id)
  </code></pre>
  <p><strong>ocr.html</strong></p>
  <pre><code>...
  &lt;a href=&quot;{% url 'delete_app_comment' comment.id %}&quot; class=&quot;btn btn-sm btn-danger&quot;
                                                 onclick=&quot;return confirm('Are you sure you want to delete this?')&quot;
  &gt;
      &lt;i class=&quot;fa fa-trash&quot; aria-hidden=&quot;true&quot;&gt;&lt;/i&gt;
  &lt;/a&gt;
  ...
  </code></pre>
  <p><strong>urls.py</strong></p>
  <pre><code>...
  url(r'^ocrs/(?P&lt;id&gt;\d+)/analysis/$', views.ocr, name=&quot;ocr&quot;),
  url(r'^comment/(?P&lt;id&gt;\d+)/analysis/$', views.delete_approval_comment, name=&quot;delete_app_comment&quot;),
  ...
  </code></pre>