Django views allow you to create much more than just HTML pages. You can generate files of any type. For example, in the Exposing settings in JavaScript recipe in Chapter 4, Templates and JavaScript, our view provides its output as a JavaScript file rather than HTML. You can also create PDF documents for invoices, tickets, booking confirmations, and so on. In this recipe, we will show you how to generate résumés (curricula vitae or CVs) in PDF format using data from the database. We will be using the Pisa xhtml2pdf library, which is very practical as it allows you to use HTML templates to make PDF documents.
Generating PDF documents
Getting ready
First of all, we need to install the xhtml2pdf Python library in your...