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

Setting up our example


In Chapter 2, we worked with the Press Release application, configuring it to work with both regular and generic views. Let's continue to use this application and modify it to serve data in a few different formats. Also, at the end of Chapter 2 we set up our application to serve the detail page with a generic view, saving us from having to write a view to serve the detail of a press release.

Because we want to customize the output of our detail page based on the presence of a variable in the URL, we're going to use our view function again instead of the generic view. If you didn't delete it, the view function should still be in your mycompany/press/views.py file. (It's included below in case you deleted it.)

Edit your mycompany/press/urls.py file, removing the generic view for the press release detail page and inserting the highlighted line as shown:

urlpatterns = patterns('',
    (r'detail/(?P<pid>\d+)/$',
        'mycompany.press.views.detail'), 
    (r'list/...
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