5. URLs, HTTP Mechanisms, and Views

In the previous chapter, you learned how to define the data models which form the underpinnings of most Web applications; in the chapter following this one, we show you how to display those models with Django’s template language and forms. However, by themselves those two aspects of a Web framework don’t do much; you need controller logic deciding what data to render which template with and URL dispatching to determine what logic is performed for a given URL.

This chapter details how Django implements the HTTP request-response architecture introduced in Chapter 3, “Starting Out,” followed by an explanation of the simple Python functions that form controller logic, as well as some built-in helper functions that ...

Get Python Web Development with Django® 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.