{"categories":[{"label":"Python Modules","url":"https://skillfed.io/packages/category/software-development-libraries-python-modules/15"},{"label":"Dynamic Content","url":"https://skillfed.io/packages/category/internet-www-http-dynamic-content/2"}],"enrichment":{"capability":"Provides Django class-based views and response classes for generating PDF documents from HTML templates using WeasyPrint.","skillfed_tags":["pdf-generation","django-integration"],"use_cases":["Generate invoices or receipts as PDF downloads from Django template-based views.","Create printable reports or data exports from Django querysets rendered as styled HTML.","Build PDF certificates or documents dynamically based on user data in a DetailView.","Serve inline PDF previews in a web interface without leaving Django.","Generate PDFs asynchronously in Celery tasks using WeasyPrint's HTML and write_pdf methods."],"what_it_does":"Django-WeasyPrint bridges Django's template system with WeasyPrint, a Python library that converts HTML and CSS into PDF documents. It provides both a class-based view mixin (`WeasyTemplateResponseMixin`) and a standalone response class (`WeasyTemplateResponse`) that handle the boilerplate of rendering a Django template to HTML, then converting that HTML to PDF. You use it by inheriting from the mixin in your view, optionally configuring PDF-specific settings like filename and attachment behavior, and the view automatically returns a PDF response instead of HTML.\n\nThe package handles URL fetching for resources like stylesheets and images through a customizable `DjangoURLFetcher` that understands Django's static files and URL schemes. It supports both inline PDF display and download-dialog attachment modes, PDF options (like accessibility variants), and dynamic filename generation. The integration is minimal\u2014most of the heavy lifting is delegated to WeasyPrint itself, which means you write standard Django templates and CSS, then get PDFs without extra conversion steps.","worth_installing":"Yes. The package is actively maintained, has low install friction, carries no known vulnerabilities, and uses a permissive license. It is a straightforward, well-tested integration layer for a common need (PDF generation from Django templates). Install it if you need to generate PDFs from Django views or templates."},"id":"django-weasyprint","links":{"html":"https://skillfed.io/packages/django-weasyprint","md":"https://skillfed.io/packages/django-weasyprint.md","pypi":"https://pypi.org/project/django-weasyprint/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-04-10","license_spdx":null,"license_treatment":"permissive","name":"django-weasyprint","python_support":"supports_current","summary":"Django WeasyPrint integration"},"popularity":{"monthly_downloads":248426,"position":8666,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"2.5.0"}
