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.

Get Django Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.