Render any Django template to a PDF using Gotenberg
Project description
Django Gotenberg is a Django app that provides a render_to_pdf function to render Django templates to PDF responses using a Gotenberg instance.
Static files referenced via {% static %} tags in the template are resolved and sent to Gotenberg alongside the rendered HTML so that images, stylesheets, and other assets are embedded correctly in the generated PDF.
Quick start
Run a Gotenberg instance:
docker run --rm -p 3000:3000 gotenberg/gotenberg:8
Add GOTENBERG_HOST to your Django settings:
GOTENBERG_HOST = 'http://localhost:3000'
Use render_to_pdf in your views:
from django_gotenberg import render_to_pdf def my_view(request): return render_to_pdf(request, 'my_template.html', {'key': 'value'}) # With a download filename: def my_download_view(request): return render_to_pdf(request, 'my_template.html', filename='report.pdf')
Configuration
All configuration is done via Django settings:
Setting |
Description |
Default |
|---|---|---|
GOTENBERG_HOST |
URL of the Gotenberg instance (required) |
— |
GOTENBERG_TIMEOUT |
Request timeout in seconds |
30.0 |
GOTENBERG_USERNAME |
HTTP basic auth username |
— |
GOTENBERG_PASSWORD |
HTTP basic auth password |
— |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_gotenberg-0.1.0.tar.gz.
File metadata
- Download URL: django_gotenberg-0.1.0.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e7396e44587ab072871ea6e6ea79100cd9be730ecc47e0b86dd9afae1ff3865e
|
|
| MD5 |
f41b835b2a26e3827b9bd95b72cef8e5
|
|
| BLAKE2b-256 |
14861299707922333a74e629c7455f48456fb85522d5e8b3fd261747112050df
|
Provenance
The following attestation bundles were made for django_gotenberg-0.1.0.tar.gz:
Publisher:
python-publish.yml on kuboschek/django-gotenberg
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_gotenberg-0.1.0.tar.gz -
Subject digest:
e7396e44587ab072871ea6e6ea79100cd9be730ecc47e0b86dd9afae1ff3865e - Sigstore transparency entry: 1005361522
- Sigstore integration time:
-
Permalink:
kuboschek/django-gotenberg@d15ff0bec3222e3538ccad4b8694f77e26df4e84 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/kuboschek
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@d15ff0bec3222e3538ccad4b8694f77e26df4e84 -
Trigger Event:
push
-
Statement type:
File details
Details for the file django_gotenberg-0.1.0-py3-none-any.whl.
File metadata
- Download URL: django_gotenberg-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
17a97c2470edb2d6e1818ebb4265524923a7ea759e48aa4394b585e5356eee3b
|
|
| MD5 |
2745f212203078d50cf2c2c670a446d6
|
|
| BLAKE2b-256 |
c5ecd55abba6d03454acd7ad6e1406d21d5443708cfa9e74b8e0f2ae9c1ca564
|
Provenance
The following attestation bundles were made for django_gotenberg-0.1.0-py3-none-any.whl:
Publisher:
python-publish.yml on kuboschek/django-gotenberg
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_gotenberg-0.1.0-py3-none-any.whl -
Subject digest:
17a97c2470edb2d6e1818ebb4265524923a7ea759e48aa4394b585e5356eee3b - Sigstore transparency entry: 1005361534
- Sigstore integration time:
-
Permalink:
kuboschek/django-gotenberg@d15ff0bec3222e3538ccad4b8694f77e26df4e84 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/kuboschek
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@d15ff0bec3222e3538ccad4b8694f77e26df4e84 -
Trigger Event:
push
-
Statement type: