DEV Community

Discussion on: How to Create PDF Documents with Django in 2019

Collapse
 
karimerto profile image
Karimerto

I was just working on something similar. My two cents on the questions above.

2) Create a new file, such as pdf.py, and put all the code there. You can then either import it in your views.py or use directly as a view in urls.py (assuming you define a function that takes request as parameter).
3) It is possible to use static files by using a custom url_fetcher. Or just use django-weasyprint module, as that takes care of it for you.