Book Image

Django 1.0 Template Development

Book Image

Django 1.0 Template Development

Overview of this book

Table of Contents (17 chapters)
Django 1.0 Template Development
Credits
About the Author
About the Reviewers
Preface
Index

Chapter 2. Views, URLs, and Generic Views

Many developers new to Django get tripped up on the vocabulary and purpose of different pieces of the system—models, views, generic views, model managers, and so on. With some functions belonging to models and others to views, it can be confusing to know where to put the logic of your applications.

The view is where most of your application logic will be executed. Before we can work with views, however, we need to look at the URL dispatching system to see how a view is matched up with an incoming request. Once we have seen the URL dispatcher and some working views, we'll take a look at some shortcuts Django offers us to accomplish these actions even more quickly.

You can write entire Django sites without using models, but you'd have a hard time doing that without views or generic views.

In this chapter, we will:

  • Create a sample application to work with

  • Learn how the URL dispatcher works and how URLs are matched to views

  • Explore the structure of views

  • Build...