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

Summary


In this chapter, we've explored the topic of serving content with multiple templates. We looked at the different approaches available to serve content to mobile devices, including using basic templates and content adaptation.

We learned how to detect the presence of a URL parameter to dynamically choose the template loaded in a view, and how to use the TEMPLATE_DIRS setting to override a template on demand without having to change any code.

Finally, we leaned how to serve a second set of templates to a separate domain name by creating a settings file to override the default settings. We also explored a technique using middleware to redirect users to a different URL based on their browser's user agent string.

In the next chapter, we'll look at Custom Tags and Filters.