I found an article that described how theonion.com did something
similar. Their url is the slug and an ID separated by a comma. The
article said pulling by ID gives a performance gain. But they wanted
to keep the seo friendly url as well.
http://www.theonion.com/articles/secretary-of-agriculture-a
Hi all -
Question. I would love to use a slug in the usual way for nice urls:
#urls.py
urlpatterns = patterns('app.views',
(r'^(?P.*)/foo/$', 'viewfunction'),
)
#views.py
def viewfunction(request, myslug):
themodel = get_object_or_404(MyModel, slug=myslug)
However, due to requirements '
2 matches
Mail list logo