O'Reilly logo

Django Unleashed by Andrew Pinkham

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required