Chapter 6. Configuring Web Page Views

What You’ll Learn in This Hour

  • How to pass extra options to a view function
  • How to implement view prefixes
  • How to create URLconf files for each application
  • How to use a callable object instead of a string in an URL pattern

In Hour 4, “Creating the Initial Views,” you learned how to set up the initial views in the URLconf file. In this hour, we will expand on that topic to include more advanced configuration options for views. When designing your website, the more complete your URLconf file configuration for web page views is, the easier it is to keep your code in the view cohesive and clean.

The following sections describe some advanced configuration options that you can make in the URLconf and views.py files. ...

Get Sams Teach Yourself Django in 24 Hours 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.