title: django redirect after form submission not working
body: <p>new to django</p>
  
  <p>so this one probably has a very simple answer but i cannot for the life of me find the specific solution to this. I am simply trying to redirect to a new URL after a form submission with a FileField.</p>
  
  <p>I can navigate to the URL separately and it works fine.</p>
  
  <p>The file uploads correctly so I know it is validated correctly.</p>
  
  <p>But the redirect returns the following error:</p>
  
  <pre><code>Reverse for 'success' not found. 'success' is not a valid view function or pattern name.
  </code></pre>
  
  <p>I have tried a bunch of different naming conventions, but none has worked. It looks to me like I have setup the URL and passed it correctly.</p>
  
  <p>Would really appreciate some help with this. The simplest problems are the most frustrating!</p>
  
  <p>Here are the views.</p>
  
  <pre><code>from django.shortcuts import render, redirect
  from django.http import HttpResponse, HttpResponseRedirect
  from django.urls import reverse
  from .forms import InvestmentReportForm
  
  def upload(request):
      if request.method == 'POST':
          form = InvestmentReportForm(request.POST, request.FILES)
  
          if form.is_valid():
              form.save()
  
              return redirect('success')
      else:
          form = InvestmentReportForm()
      return render(request, 'app/upload.html', {'form': form})
  
  def success(request):
      return HttpResponse("File successfully uploaded")
  </code></pre>
  
  <p>And my urls.py:</p>
  
  <pre><code>app_name = 'app'
  urlpatterns = [
                  path('', views.index, name='index'),
                  path('upload/', views.upload, name='upload'),
                  path('success/', views.success, name='success'),
                  path('performance/', views.performance, name='performance'),
                  ]
  </code></pre>