title: DJANGO Generic Views: How to use reverse() in get_absolute_url method?
body: <p>I'm trying to implement generic editing views as shown <a href="https://docs.djangoproject.com/en/1.9/ref/class-based-views/generic-editing/" rel="nofollow">here</a>:</p>
  
  <p>I started with the CreateView which renders and submits data correctly. However, I am getting an error when I tries to use reverse() to return to the detail view page for the new object. </p>
  
  <p>Here is my Error message:</p>
  
  <blockquote>
    <p>NoReverseMatch at /work/clients/create/
    Reverse for 'ClientDetailView' with arguments '('14',)' and keyword arguments '{}' not found. 0 pattern(s) tried: []</p>
  </blockquote>
  
  <p>Here is how I defined get_absolute_url() in my model:</p>
  
  <pre><code>def get_absolute_url(self):
      return reverse('ClientDetailView', kwargs={'pk': self.pk})
  </code></pre>
  
  <p>My view is called ClientDetailView. I'm not sure what other information would be helpful. </p>
  
  <p>Here is class ClientDetailView:</p>
  
  <pre><code>class ClientDetailView(generic.DetailView):    
      model = Client
      template_name = 'work/client_detail.html'`
  </code></pre>
  
  <p>and here is <code>url()</code> from urls.py:</p>
  
  <pre><code>url(r'^clients/(?P&lt;pk&gt;[0-9]+)/$', views.ClientDetailView.as_view(), name='clients_detail'),`
  </code></pre>
  
  <p>Can anyone explain what I am doing wrong?</p>