title: Django file upload: redirect views keep returning errors
body: <p>I have been working on this music site in Django, basically just trying to get the upload view to work. When you upload a music file, I want it to redirect to the results page. I have been having real trouble with trying to get the redirect to work and it should be very simple but just has not been working. Any help would be greatly appreciated!! My error: </p>
  
  <blockquote>
    <p>ValueError at /uploads/home/
    The view uploads.views.upload didn't return an HttpResponse object. It returned None instead.</p>
  </blockquote>
  
  <p>uploads/views.py (relevant buggy code):</p>
  
  <pre><code>def upload(request):
      if request.method == 'POST':
          form = UploadFileForm(request.POST, request.FILES)
          if form.is_valid():
              form.save()
              return redirect('uploads:results')
  
          else:
              form = UploadFileForm()
          return render(request, 'uploads/upload.html', {'form': form})
  </code></pre>
  
  <p>uploads/urls.py</p>
  
  <pre><code>from django.urls import path
  
  from . import views
  
      app_name = 'uploads'
  
      urlpatterns = [
          path('home/', views.upload, name='index'),
          path('&lt;int:audiofile_id&gt;/results/', views.ResultsView.as_view(), name='results'),
      ]
  </code></pre>
  
  <p>upload.html (the upload template)</p>
  
  <pre><code>{% extends 'uploads/base.html' %}
  
  {% if error_message %}&lt;p&gt;&lt;strong&gt;{{ error_message }}&lt;/strong&gt;&lt;/p&gt;{% endif %}
  {% block content %}
  &lt;div class="container"&gt;
      &lt;div class="row"&gt;
          &lt;div class="col-lg-12 col-md-8"&gt;
              {% for audiofile in audiofiles %}
                &lt;h1&gt;{{ audiofile.title }}&lt;/h1&gt;
  
  
  
  
          &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="row"&gt;
  
          &lt;div class="col-lg-12 col-md-8"&gt;
        &lt;form action="{% url 'uploads:results' audiofile_id %}" method="post" name = "form" enctype = "multipart/form-data"&gt;
          {% csrf_token %}
          {{ form }}
          &lt;input type="submit" value="Submit"&gt;
          &lt;/form&gt;
              {% endfor %}
          &lt;/div&gt;
          &lt;/div&gt;
  
          &lt;!--&lt;div class="row"&gt;--&gt;
          &lt;!--    &lt;div class="col-lg-8"&gt;--&gt;
          &lt;!--&lt;img src="{% static "uploads/loveLogo.jpg" %}" alt="lovelogo" class="img-fluid"&gt;--&gt;
          &lt;!-- &lt;/div&gt;--&gt;
          &lt;!-- &lt;/div&gt;--&gt;
           &lt;/div&gt;
  
   {% endblock %}
  </code></pre>