Slug urlconf regex pattern for Django urlpatterns
If you want to match a slug in your urls.py, use (?P[-\w]+) as a named match pattern:
So, if you wanted to match http://example.com/some-slug-name/, you would use
urlpatterns = patterns('',
# ...
url(r'^(?P<slug>[-\w]+)/$', some_view),
# ...
)
I got this info from a Django Users Thread on google groups.