November 2015
Beginner to intermediate
840 pages
26h 30m
English
To point Django to views, developers build URL patterns.
A URL pattern consists at least of (1) a regular expression pattern and (2) a reference to a view. A URL pattern may additionally define (3) a dictionary, which is passed to the view as keyword arguments, and (4) a name, allowing for the developer to interact with the URL pattern throughout the rest of the site.
The regular expression pattern is used to match a URL path. For instance, a regular expression pattern ^tag/[\w\-]+/$ will match /tag/django/ and /tag/video-games/. If a match occurs, Django calls the view that is associated with the regular expression pattern’s URL pattern.
A list of URL patterns is called a URL configuration. A URL pattern ...
Read now
Unlock full access