12.2 Django’s Core
A website is an application that interacts with users via a stateless protocol: HTTP. A user sends a request, and the website returns a response.
At start, Django loads into memory all of the URL patterns we have configured in our URL configuration tree. When Django receives an HTTP request, it translates the data into a Python HttpRequest object. It then passes the object to the URL dispatch system, which attempts to match the URL path of the request with one of the regular expression patterns in the URL configuration tree. If one of the regular expressions patterns matches, the dispatch system sends the HttpRequest to the view that the URL pattern references. Django, at its most basic, is visualized in Figure 12.1.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access