Skip to content

Commit

Permalink
Use django_url_fetcher directly in example
Browse files Browse the repository at this point in the history
  • Loading branch information
fdemmer committed Feb 23, 2024
1 parent 017568d commit bc7aff5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,14 @@ Example
from celery import shared_task
from django.template.loader import render_to_string
from views import custom_url_fetcher
from django_weasyprint.utils import django_url_fetcher
@shared_task
def generate_pdf(filename='mymodel.pdf'):
weasy_html = weasyprint.HTML(
base_url='file://',
string=render_to_string('mymodel.html'),
url_fetcher=custom_url_fetcher,
url_fetcher=django_url_fetcher,
base_url='file://',
)
weasy_html.write_pdf(filename)
Expand Down

0 comments on commit bc7aff5

Please sign in to comment.