title: Django render() - Reverse for '' not found. '' is not a valid view function or pattern name
body: <p>This is yet another question involving paths in Django. I have not been able to find my answer anywhere and have done lots of searching on this. </p>
  
  <p>The <code>return()</code> function in my view is throwing the error </p>
  
  <blockquote>
    <p>django.urls.exceptions.NoReverseMatch: Reverse for '' not found. '' is not a valid view function or pattern name. </p>
  </blockquote>
  
  <p>Here is my code.</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;!-- siren_search.html --&gt;
      &lt;div class="row"&gt;
          &lt;div class="col-sm-8 col-md-7 col-xl-5 mx-auto"&gt;
              &lt;form id="searchform" action="{% url 'search' %}" method="GET"&gt;
                  &lt;input id="searchbar" name="query" autocomplete="on" onkeyup=getCameras(this.value)
                      placeholder="Search for the name of a jobsite." class="form-control" type="search" /&gt;
              &lt;/form&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  
  <pre class="lang-py prettyprint-override"><code>#### urls.py
  
  from django.urls import path, re_path
  from . import views
  
  urlpatterns = [
      path('', views.siren_home, name = 'siren_home'),
      re_path(r'^search/$',views.search, name = 'search')
  ]
  </code></pre>
  
  <pre class="lang-py prettyprint-override"><code>
  #### views.py
  
  from django.shortcuts import render
  from django.http import HttpResponse, JsonResponse
  from django.core.exceptions import ObjectDoesNotExist
  from .models import CameraSystem, CameraModel, ControlByWeb, JobSite
  from django.core import serializers
  import json
  
  def siren_home(request):
  
      # some functionality
  
      return render(request, 'siren_search.html', context)
  
  def search(request):
  
      term = request.GET.get('query')
      context = {}
  
      # Handle when the user presses enter on the search bar
      if 'query' in request.GET and term != '' and not request.is_ajax():
          try:
              jobsite = JobSite.objects.get(name__iexact = term)
              cameras = jobsite.camerasystem_set.all()
              context = {
                  'cameras': cameras,
              }
  
          except ObjectDoesNotExist:
              pass
  
          return render(request, 'siren_search.html', context) # Django fails here
      else:
          return render(request, 'siren_search.html', context)
  </code></pre>
  
  <p>When I hit enter on the search bar it will route to the proper view function and do all the necessary computations, but it fails on the render() function. The url I have in my browser is: <code>http://localhost:8000/siren-search/search/?query=jobsite9</code>.</p>
  
  <p>Here is a link to my traceback: <a href="http://dpaste.com/2KFAW9M#" rel="nofollow noreferrer">http://dpaste.com/2KFAW9M#</a></p>