November 2015
Beginner to intermediate
840 pages
26h 30m
English
We’ve discovered that a URL configuration is a list of URL patterns, stored by convention in a variable named urlpatterns. What I (and others) casually refer to as a URL pattern is actually a RegexURLPattern object. Each call to url() instantiates a RegexURLPattern; a URL configuration is thus a list of RegexURLPattern objects stored in a variable named urlpatterns.
Each RegexURLPattern is instantiated by a call to url() (see Example 5.32), which takes as mandatory arguments (1) a regular expression pattern and (2) a reference to a view. As an optional argument, it’s possible to pass (3) a Python dictionary, where each key value is passed to the view as keyword arguments. We will see this in action before the ...
Read now
Unlock full access