django-weasyprint
django-weasyprint copied to clipboard
Collaborating with django-renderpdf
Hi! I maintain django-renderpdf, which I wrote back in 2017 to, well, render PDFs. It also uses weasyprint under the hood.
I've come across django-weasyprint a few times during the years. It seems that around 80% of what both projects do is the same. There's some duplicate effort going on between both projects. I'd like to contribute to django-weasyprint by merging any functionality that's missing, and then have a migration plan to transition projects from django-renderpdf into django-weasyprint.
I wanted to hear your thoughts on this and see if this sounds good to you too before actually doing anything.
From what I can tell, these are the biggest differences with django-renderpdf:
- Aside from PDF views, it also allows rendering a PDF outside of a request-response cycles (in particular, I generate a lot of PDFs in celery/rq tasks). This is done by having the rendering function outside of the View class.
- There's a custom
django_url_fetcherthat tries to resolve static files. This avoids network round-trips to reload the same CSS and PNG files over the network over and over again. I do think that your approach using abase_urlis simpler for a lot of cases. - A flag to prompt downloads the PDF instead of opening it in the browser.
get_template_namesuses the same convention as Django, to allow applications to override templates (django-afip relies on this to use a rather flexible template overriding mechanism in the same way as Django itself does for built-in views).- Finally, there's published docs for all the public API.
@WhyNotHugo the link you provided to django-renderpdf doesn't work. 404.
Is your project better maintained than this?
My bad, correct link here: https://github.com/WhyNotHugo/django-renderpdf/
Thank you for reaching out @WhyNotHugo!
In 2016 I also took over this code due to stagnant maintenance and am very much open to collaboration and/or merging of projects to keep it alive now. There should be one -- and preferably only one -- obvious way to do it. ;)
I'd like to contribute to django-weasyprint by merging any functionality that's missing, and then have a migration plan to transition projects from django-renderpdf into django-weasyprint.
That sounds like a good plan and I am open to accept pull-requests in that direction and probably subsequently handing over maintenance/access to this project's github/pypi.