title: View didn't return an HttpResponse object. It returned None instaed
body: <p>I'm using <code>Django 1.11</code> and I'm trying to improve an existing code which let to export data to an Excel file. There are 2 cases :</p>
  
  <ul>
  <li><p>File contains less than 70.000 rows. In this way, user can directly download the generated output file.</p></li>
  <li><p>File contains more than 70.000 rows. In this case, the file is written in the media folder.</p></li>
  </ul>
  
  <p>I'm getting an issue with the second part.</p>
  
  <p>The file is well-written in the Media folder, but I don't find a way to provide an HttpResponse object.</p>
  
  <p>In my HTML template, I have this link :</p>
  
  <pre><code>&lt;a title="Export to Excel" class="button btn btn-default" href="{% url 'app:export-xls' model=model %}"&gt;
      &lt;span class="glyphicon glyphicon-export"&gt;&lt;/span&gt;
  &lt;/a&gt;
  </code></pre>
  
  <p>In my view, I have this file :</p>
  
  <pre><code>class ExportAPP(View):
  
      def export_xls(self, model=""):
          app_label = 'app'
  
          # create a workbook in memory
          output = io.BytesIO()
  
          book = Workbook(output, {'constant_memory': True})
          sheet = book.add_worksheet('Page 1')
          # Sheet header, first row
          row_num = 0
  
          #Part which fill the file, adjust columns etc ..
          ...
  
          book.close()
  
          if len(rows) &lt; 70000:
              # construct response
              output.seek(0)
              name = 'Obsolete' if obsolete else ''
              name += str(model._meta.verbose_name_plural)
              response = HttpResponse(output.read(),
                                  content_type="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
              response['Content-Disposition'] = 'attachment; filename="' + name + '.xlsx"'
              return response
  
          #The interesting part
          else:
              print('Export contains more than 70.000 entries')
              output.seek(0)
              name = 'Obsolete' if obsolete else ''
              name += str(model._meta.verbose_name_plural)
  
              name = name + "_" + str(datetime.now().strftime("%Y_%m_%d_%H_%M_%s")) + '.xlsx'
              file = default_storage.save(name, output)
  </code></pre>
  
  <p>I'm getting this issue :</p>
  
  <p><code>The view app.views.export.export_xls didn't return an HttpResponse object. It returned None instead.</code></p>
  
  <p>I would like to return the same template page but I don't find a way to do that.</p>