title: Django 2 - reverse for view not found
body: <p>I know there are already a hundred of these, but I have one app that I made, that works, and a new one I'm trying to make, that doesn't work.</p>
  
  <p>I can't redirect to my <code>'detail'</code> view from my create view. If I put a number into the address, it works, it is just the redirect that doesn't work. I've tried a couple of things to no avail. I'm sure it is something simple, I just can't see it.</p>
  
  <p>urls.py</p>
  
  <pre><code>from django.urls import path
  
  from . import views
  app_name = 'service'
  urlpatterns = [
          path('', views.create_employee_profile,    
              name='create_employee_profile'),
          path('&lt;int:pk&gt;/', views.customer_employee_profile_detail,
              name='detail'),
  ]
  </code></pre>
  
  <p>view.py</p>
  
  <pre><code>from django.shortcuts import render, redirect
  
  from service.forms import EmployeeNameForm
  
  def create_employee_profile(request):
  
      if request.POST:
          name_form = EmployeeNameForm(request.POST)
  
          if name_form.is_valid():
              new_name_form = name_form.save()
              return redirect('service:detail', pk=new_name_form.pk)
  
          else:
              return render(request, 'service/create_or_update_profile.html',
                          {'name_form': name_form})
  
      else:
          name_form = EmployeeNameForm()
          return render(request, 'service/create_or_update_profile.html',
                          {'name_form': name_form})
  
  def customer_employee_profile_detail(request, pk):
      name = get_object_or_404(CustomerEmployeeName, pk=pk)
      return render(request,
                      'service/customer_employee_profile_detail.html', 
                      {'name': name}
                  )
  </code></pre>
  
  <p>I've tried both <code>'detail'</code> and <code>'service: detail'</code> as well. Error is:
  <code>Reverse for 'detail' not found. 'detail' is not a valid view function or pattern name.</code></p>
  
  <p>Template</p>
  
  <pre><code>{% extends 'base.html' %}
  
  {% block content %}
      &lt;form method="post" action=""&gt;
          {% csrf_token %}
  
          &lt;!--Content Header Bar--&gt;
          &lt;nav class="navbar navbar-light bg-light"&gt;
              &lt;span class="navbar-brand mb-0 h1"&gt;Name and Address&lt;/span&gt;
          &lt;/nav&gt;
          &lt;div class="form-group"&gt;
              {% include 'service/name_form_template.html' %}
          &lt;/div&gt;
          &lt;button type="submit" class="btn btn-primary" style="background-color: SteelBlue;"&gt;
              Save
          &lt;/button&gt;
      &lt;/form&gt;
  {% endblock %}
  </code></pre>
  
  <p>The included template holds the layout. </p>
  
  <p>The reason I’m not using generic views is because these will views will eventually contain multiple forms. I’m trying to build it like legos, start small and add on. </p>