title: Django reply to comment in ajax does not work
body: <p>I am writing an application in django 2.2 with ajax. It's about the comments section and responses to comments. I have two problems:</p>
  
  <ol>
  <li><p>Writing a new comment works. The response to the comment does not work, an error appears: <code>The view spot.views.SpotDetailView didn't return an HttpResponse object. It returned None instead.</code></p></li>
  <li><p>Validation - if a comment is added, it works, but the error appears on all windows to respond to comments. The validation of the response to the comment does not work, the page source appears instead of the error</p></li>
  </ol>
  
  <p>view.py</p>
  
  <pre><code>class SpotDetail(DetailView):
      model = Spot
      context_object_name = 'spot'
  
      def get_context_data(self, **kwargs):
          context = super().get_context_data(**kwargs)
          context['form'] = CommentModelForm()
          return context
  
  
  class SpotDetailView(View):
      def get(self, request, *args, **kwargs):
          view = SpotDetail.as_view()
          return view(request, *args, **kwargs)
  
      def post(self, request, *args, **kwargs):
          view = SpotComment.as_view()
          return view(request, *args, **kwargs)
  
  class SpotComment(SingleObjectMixin, FormView):
      template_name = 'spot/spot_detail.html'
      form_class = CommentModelForm
      model = Spot
  
      def get_success_url(self):
          return reverse('spot_detail_url', kwargs={'slug': self.object.slug, 'id': self.object.pk})
  
      def post(self, request, *args, **kwargs):
          self.object = self.get_object()
          form = self.form_class(request.POST)
          form.instance.spot = self.object
          form.instance.author = self.request.user
  
          if form.is_valid():
              reply = request.POST.get('comment_id')
              comment_qs = None
              if reply:
                  comment_qs = Comment.objects.get(id=reply)
                  form.instance.reply = comment_qs
              form.save()
  
              if request.is_ajax():
                  context = {
                      'form': form,
                      'errors': form.errors,
                      'object': self.object,
                  }
                  html = render_to_string('spot/comments.html', context, request=request)
                  return JsonResponse({'form': html})
          else:
              context = {
                  'form': form,
                  'errors': form.errors,
                  'object': self.object,
              }
              html = render_to_string('spot/comments.html', context, request=request)
              return JsonResponse({'form': html})
  </code></pre>
  
  <p>jQuery code:</p>
  
  <pre><code>$(document).on('submit', '.comment-form', function(event){
      event.preventDefault();
      var serialized = $('.comment-form').serialize();
      $.ajax({
          type: 'POST',
          url: $(this).attr('action'),
          data: serialized,
          dataType: 'json',
          success: function(response){
              $('.comment-section').html(response['form']);
              $('textarea').val('');
              $('.reply-btn').click(function(){
                  $('.replied-comment').fadeToggle();
                  $('textarea').val('');
              });
          },
          error: function(rs, e){
              console.log(rs.responseText);
          }
      });
  });
  
  $(document).on('submit', 'form[id^="reply-comment-"]', function(event){
      event.preventDefault();
      var pk = $(form[id^="reply-comment-"]).attr('value');
      var serialized = $('#reply-form' + pk).serialize();
      $.ajax({
          type: 'POST',
          url: $(this).attr('action'),
          data: serialized,
          dataType: 'json',
          success: function(response){
              $('.comment-section').html(response['form']);
              $('textarea').val('');
              $('#reply-comment-btn-' + pk).click(function(){
                  $('.replied-comment').fadeToggle();
                  $('textarea').val('');
              });
          },
          error: function(rs, e){
              console.log(rs);
          }
      });
  });
  </code></pre>