November 2015
Beginner to intermediate
840 pages
26h 30m
English
include to Create a Hierarchy of URL ConfigurationsThe second argument passed to url() need not point at a view: it can point at another URL configuration, thanks to the include() function. This capability allows us to create a separate URL configuration in each Django app and have a URL pattern in the site-wide URL configuration point to each one. In effect, the full URL configuration is not a simple list but is actually a tree, where the leaves of the tree are webpages (see Figure 5.6).
Figure 5.6: URL Configuration Tree
When a URL pattern points to a URL configuration, the regular expression pattern acts as a URI prefix. For ...
Read now
Unlock full access