Enable sluggified URLs in Django Enable sluggified URLs in Django django django

Enable sluggified URLs in Django


I should have been just a little more patient before asking this question because I figured out the answer:

(r'^(?P<object_id>\d+)/$',  'django.views.generic.list_detail.object_detail', info_dict),(r'^(?P<object_id>\d+)/(?P<slug>[-\w]+)/$',  'django.views.generic.list_detail.object_detail', info_dict),

The first pattern allows URLs of the form /articles/1/ which means that the second urlpattern (to include the slug) is optional.