title: Django URL Patterns
body: <p>I've created a very simple blog, but have been running into a couple URL issues. For my tag &amp; specific post views I run into the following issues.</p>
  
  <p><strong>Specific Post View Example</strong><br>These two sites render the same, and would like the second one to render a 404. <br>website.com/post/1/hello-world <br> website.com/post/1/hello-world/non-sense (should render 404)</p>
  
  <p><strong>Tag View</strong><br>
  website.com/tag/python: this will render all posts tagged python, great. However...<br>
  website.com/tag/python/party: this will render all posts tagged "python/party" instead of rendering a 404.</p>
  
  <p>Here is my URL patterns setup so you can take a look.</p>
  
  <pre><code>url(r'^post/(?P&lt;pk&gt;\d+)/(?P&lt;post_title&gt;)', DetailView.as_view(
                          model = post,
                          template_name = "post.html")),
  url(r'^post/$', ListView.as_view(
                          queryset = post.objects.all().order_by("-date"),
                          template_name = "archives.html")),
  url(r'^archives/$', ListView.as_view(
                          queryset = post.objects.all().order_by("-date"),
                          template_name = "archives.html")),
  url(r'^tag/(?P&lt;tag&gt;[\w|\W]+)', 'tags'),
  </code></pre>
  
  <p><strong>Updated</strong><br>
  Solution for tag:</p>
  
  <pre><code>url(r'^tag/(?P&lt;tag&gt;[\w]+)\W*/$', 'tags'),
  </code></pre>
  
  <p>Solution for post:</p>
  
  <pre><code>url(r'^post/(?P&lt;pk&gt;\d+)/(?P&lt;post_url&gt;[\w-]+)/$', DetailView.as_view(
                          model = post,
                          template_name = "post.html")),
  </code></pre>
  
  <p><strong>Thank you Huckleberry Finn and krakax for all the help!</strong></p>