Book Image

Learning Website Development with Django

Book Image

Learning Website Development with Django

Overview of this book

Table of Contents (18 chapters)
Learning Website Development with Django
Credits
About the Author
About the Reviewers
Preface
Index

Summary


You have learned many interesting features in this chapter. You are now able to create any type of web feed with ease. You also gained a lot of information on how to use the Django database API to query data models in various ways. Finally, you learned about pagination in Django and applied it to a view in the project.

Here is a quick summary of the features covered in this chapter:

  • To create a feed in Django, derive a class that represents the feed from the Feed base class, and define the properties of the feed (title, link, description) and a method called items that returns the items of the feed in this class.

  • To customize the rendering of item fields in the feed (such as title and description), create a folder called feeds in the templates folder. Inside it, create templates with filenames that use the following format: feedname_fieldname.html. The contents of these templates will be used to render item fields.

  • Q objects are very useful to construct complex queries. They encapsulate...