November 2015
Beginner to intermediate
840 pages
26h 30m
English
tag_detailWith our tag_detail() function view fully programmed, we now need to point Django to it by adding a URL pattern to the URL configuration. The pattern will be in the form of url(<regular_expression>, tag_detail), where the value of <regular_expression> is currently unknown. In this section, we need to solve two problems:
1. We need to build a regular expression that allows for multiple inputs. For example, /tag/django/ and /tag/web/ must both be valid URL paths.
2. We must pass the value of the slug in the URL path to the detail view.
The answer to both of these problems is to use regular expressions groups.
To solve the first case, we first begin by building a static regular expression. Remember that ...
Read now
Unlock full access