title: Django reverse error: NoReverseMatch
body: <p>I've looked at a lot of different posts, but they're all either working with a different version of django or don't seem to work. Here is what I'm trying to do:</p>
  
  <p>urls.py (for the entire project):</p>
  
  <pre><code>    from django.contrib import admin
  admin.autodiscover()
  
  urlpatterns = patterns('',
          url(r'^blog/', include('blog.urls', namespace="blog")),
          url(r'^admin/', include(admin.site.urls)),
      )
  </code></pre>
  
  <p>urls.py (specific to the app):</p>
  
  <pre><code>urlpatterns = patterns ('' ,
  url(r'^$', views.index, name='index'),
  
  url(r'^(?P&lt;slug&gt;[\w\-]+)/$', views.posts, name="postdetail"),
  
  )
  </code></pre>
  
  <p>views.py:</p>
  
  <pre><code>def index(request):
      posts = Post.objects.filter(published=True)
      return render(request,'blog/index.html',{'posts':posts})
  
  def posts(request, slug):
      post = get_object_or_404(Post,slug=slug)
      return render(request, 'blog/post.html',{'post':post})
  </code></pre>
  
  <p>And finally the template:</p>
  
  <pre><code> {% block title %} Blog Archive {% endblock %}
  
      {% block content %}
          &lt;h1&gt; My Blog Archive &lt;/h1&gt;
          {% for post in posts %}
          &lt;div class="post"&gt;
              &lt;h2&gt;
                  &lt;a href="{% url "postdetail" slug=post.slug %}"&gt;
                      {{post.title}}
                  &lt;/a&gt;
              &lt;/h2&gt;
              &lt;p&gt;{{post.description}}&lt;/p&gt;
              &lt;p&gt;
                  Posted on
                  &lt;time datetime="{{post.created|date:"c"}}"&gt;
                      {{post.created|date}}
                  &lt;/time&gt;
              &lt;/p&gt;
          &lt;/div&gt;
          {% endfor %}
      {% endblock %}
  </code></pre>
  
  <p>For some reason this gives me a "No reverse Match": Reverse for 'postdetail' with arguments '()' and keyword arguments '{u'slug': u'third'}' not found. 0 pattern(s) tried: []</p>
  
  <p>I've already tried getting rid of the double quotes around <code>postdetail</code> in the template, and I've also tried referring to it by the view name instead of the pattern name. Still no luck. The documentation isn't too helpful either. </p>
  
  <p>Help is really appreciated! Thanks</p>