Skip to main content

Django WeasyPrint CBV

Project description

A class-based view that generated PDFs using WeasyPrint

Usage

Use WeasyTemplateView as class based view base class or the just the mixin WeasyTemplateResponseMixin on a TemplateView (or subclass thereof).

Example

from django.conf import settings
from django.views.generic import DetailView

from django_weasyprint import WeasyTemplateResponseMixin


class MyModelView(DetailView):
    model = MyModel
    template_name = 'mymodel.html'


class MyModelViewPrintView(WeasyTemplateResponseMixin, MyModelView):
    stylesheets = [
        settings.STATIC_ROOT + "css/app.css",
    ]

History

2017-02-02: finally pushed new release to pypi

2016-02-08: forked to merge open pull requests

2016-01-13: official repository taken over from https://github.com/dekkers/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-weasyprint-0.5.0.tar.gz (4.4 kB view hashes)

Uploaded Source

Built Distribution

django_weasyprint-0.5.0-py2.py3-none-any.whl (6.1 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page