Django comes with a syndication feed framework that allows you to create RSS and Atom feeds easily. RSS and Atom feeds are XML documents with specific semantics. They can be subscribed in an RSS reader such as Feedly or they can be aggregated in other websites, mobile applications, or desktop applications. In this recipe, we will create BulletinFeed
, which provides a bulletin board with images. Moreover, the results will be filterable by URL query parameters.
We will create a Bulletin
model and an RSS feed for it. We will be able to filter the RSS feed by type or category so that it is possible to only subscribe to the bulletins that are, for example, offering used books:
In the
models.py
file of this app, add theCategory
andBulletin
models with a foreign key relationship between them, as follows:# bulletin_board/models.py # -*- coding: UTF-8 -*- from...