Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Django 1.0 Template Development
  • Table Of Contents Toc
Django 1.0 Template Development

Django 1.0 Template Development

By : Scott Newman
4 (2)
close
close
Django 1.0 Template Development

Django 1.0 Template Development

4 (2)
By: Scott Newman

Overview of this book

This book is designed for readers who learn by doing and employs many examples and screenshots to let the reader dig in and start coding. This book isn't designed to be a reference; instead it has a practical, example-driven approach that teaches you by following along with the examples in the chapters. When you have completed this book, you will fully understand how the template system works, how to extend it when you have specialized needs, and how to optimize the performance and usability of your content. This book is for web developers and template authors who want to fully understand and utilize the Django template system. The reader should have completed the introductory tutorials on the Django project's website and some experience with the framework will be very helpful. Basic knowledge of Python and HTML is assumed.
Table of Contents (17 chapters)
close
close
Django 1.0 Template Development
Credits
About the Author
About the Reviewers
Preface
1
Index

Using the context values in your templates


We worked with template variables in the first chapter, but didn't discuss some of the subtleties of working with different kinds of data such as methods, objects, lists, and dictionaries. The template engine provides us with a simple way to work with different kinds of data by consistently using a dotted syntax. Regardless of the type of data you are trying to retrieve, you use the same syntax.

Let's look at some examples using the Django shell to keep things simple. We'll pass strings to the Template object again to keep the examples clear, instead of loading the text from template files.

Note

Note: If you are not familiar with Python dictionaries, lists, objects, and methods, you'll probably want to brush up on these concepts before going any further. If you don't understand what you are putting into a template, you won't understand what you're getting back out.

A great reference is Mark Pilgrim's Dive Into Python, available for free at diveintopython...

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Django 1.0 Template Development
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon