Skip to content

Instantly share code, notes, and snippets.

@richleland
Created September 7, 2011 14:06
Show Gist options
  • Select an option

  • Save richleland/1200643 to your computer and use it in GitHub Desktop.

Select an option

Save richleland/1200643 to your computer and use it in GitHub Desktop.
urlpattern
# in urls.py
(r'^(?P<taxonomy>[-/\w]+)/', include('myapp.urls'))
# in myapp/urls.py
url(r'^articles/(?P<slug>[\w-]+)/$', ContentView.as_view(model=Article), name='content-article')
# why doesn't the url /foo/bar/baz/articles/my-article/ resolve?
@bfitzsimmons

Copy link
Copy Markdown

How does the first pattern know when to stop looking for more URL segments?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment