November 2015
Beginner to intermediate
840 pages
26h 30m
English
url to Create Detail Page LinksLet’s pretend for a moment that we don’t know about get_absolute_url() and that we’re going to stick to using the url template tag directly.
All of our detail pages are dynamic pages with at least one regular expression named group. To reverse a URL pattern with such regular expressions, we saw earlier that we could treat the regular expression pattern like a template and pass the value we want to fill in the character set directly to either reverse() or the url template tag.
url with Tag DetailThe URL pattern organizer_tag_detail currently reads as shown in Example 6.23.
Example 6.23: Project Code
organizer/urls.py in 0a66a80be9
17 url(r'^tag/(?P<slug>[\w\-]+)/$' ...
Read now
Unlock full access