'How to convert a view to a pdf in Django?

I need to render PDF files dynamically in a Django web app.

I understand there are 2 options :

  1. Render an html template file then convert it to a PDF file.

  2. Convert a webpage into a PDF file directly
    How to do this?
    Any solution specifically made for Django?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source