Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Django 1.0 Website Development

You're reading from   Django 1.0 Website Development Build powerful web applications, quickly and cleanly, with the Django application framework

Arrow left icon
Product type Paperback
Published in Mar 2009
Publisher Packt
ISBN-13 9781847196781
Length 272 pages
Edition 1st Edition
Tools
Arrow right icon
Toc

Table of Contents (17) Chapters Close

Django 1.0 Web Site Development
Credits
About the author
About the reviewer
Preface
1. Introduction to Django 2. Getting Started FREE CHAPTER 3. Building a Social Bookmarking Application 4. User Registration and Management 5. Introducing Tags 6. Enhancing the User Interface with AJAX 7. Voting and Commenting 8. Creating an Administration Interface 9. Advanced Browsing and Searching 10. Building User Networks 11. Extending and Deploying 12. What Next?

Generic views


While working with Django, you will notice that there are certain types of views that are always needed regardless of the project you are working on. For this reason, Django comes with a set of views that can be used in any project. These views are known as generic views and we actually used one of them in a previous chapter. Remember the direct_to_template view that renders a template into a page? This view is one example of generic views.

Django offers generic views for the following purposes:

  • Create simple views for tasks such as redirecting to another URL or rendering a template.

  • List view and detail view for displaying objects from a data model. These views are similar to how the admin page displays list and detail pages for the data models.

  • Views to generate date-based archive pages. These can be particularly useful for blogs.

  • Views for creating, editing, and deleting objects in data models.

To use one of these views, you import it from django.views.generic and then map the...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime