Chapter 14. Generating Non-HTML Content

Usually when we talk about developing websites, we're talking about producing HTML. Of course, there's a lot more to the web than HTML; we use the web to distribute data in all sorts of formats: RSS, PDFs, images, and so forth.

So far, we've focused on the common case of HTML production, but in this chapter we'll take a detour and look at using Django to produce other types of content. Django has convenient built-in tools that you can use to produce some common non-HTML content:

  • Comma-delimited (CSV) files for importing into spreadsheet applications.
  • PDF files.
  • RSS/Atom syndication feeds.
  • Sitemaps (an XML format originally developed by Google that gives hints to search engines).

We'll examine each of those tools ...

Get Mastering Django: Core now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.