title: Redirect the output of custom Django command to the browser
body: <p>I have created a custom command which takes a positional and a named optional argument. It does many checks, downloads a file, unzips it and populates the database with the unzipped data.</p>
  <p>To make the things more convenient for the users I created a simple form and created a view:</p>
  <pre><code>from django.views.generic.edit import FormView
  from django.core import management
  
  from .forms import DownloadForm
  
  class DownloadFormView(FormView):
      template_name = 'frontend/download.html'
      form_class = DownloadForm
      success_url = '.'
  
      def form_valid(self, form):
          country = form.cleaned_data['country'][:3]
          levels = int(form.cleaned_data['country'][-1:])
          management.call_command('download_shapefile', country, levels=levels)
          return super(DownloadView, self).form_valid(form)
  </code></pre>
  <p>That works fine and now I want to provide feedback to the user, as the command might run for a while.</p>
  <p>Is there any possibility to redirect the command output (or make it available) to the template and display it in the browser?</p>
  <p>In my command I use:</p>
  <pre><code>self.stdout.write(self.style.SUCCESS('some success message'))
  self.stdout.write(self.style.WARNING('some warning message'))
  </code></pre>
  <p>to output messages and don't print directly with the <code>print</code> method.</p>