O'Reilly logo

Learning Django Web Development by Ratan Kumar, Sanjeev Jaiswal

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Class-based generic views

While working with Django, you will note that there are certain types of views that are always needed regardless of the project that you are working on. For this reason, Django comes with a set of views that can be used in any project. These views are called generic views.

Django offers generic views for the following purposes:

  • To create simple views for tasks, such as redirecting to another URL or rendering a template
  • Listing and forming detail views to display objects from a data model - these views are similar to how the admin page displays lists and detail pages for data models
  • To generate date-based archive pages; these can be particularly useful for blogs
  • To create, edit, and delete objects in data models

Django's class-based ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required