Package: django-template-engines
django-template-enginesDescriptionAdditional template engines for Django.Generate :PDF (with weasyprint)ODT (beta)DOCX (alpha)RequirementsWeasyprint has specific requirementshttps://weasyprint.readthedocs.io/en/stable/install.htmlHow to use a specific template backendIn the settings, add:INSTALLED_APPS = [
    ...
    'template_engines',
]

...
# Put custom engines before DjangoTemplates Engine (Custom engines will search ONLY template ending with .pdf (weasyprint) .odt (odt) and .docx (docx)
TEMPLATES = [
    {
        'BACKEND': 'template_engines.backends.weasyprint.WeasyprintEngine',
        'APP_DIRS': True,
        'DIRS': [
        ],
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
    {
        'BACKEND': 'template_engines.backends.odt.OdtEngine',
        ...,
    },
    {
        'BACKEND': 'template_engines.backends.docx.DocxEngine',
        ...,
    },
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [
        ],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]Documentationhttps://django-template-engines.readthedocs.io/CHANGELOG1.3.10          (2022-06-22)Add support for sub and sup html tags for odt1.3.9           (2022-04-26)Support django 3.2, django 4.0 and python 3.10Add url in logger template tagimage_url_loader1.3.8           (2020-10-15)allow to use image url loader in pdfs templates1.3.7           (2020-10-14)allow cases where django change pdf suffix1.3.6           (2020-10-14)WARNING : Breaking changePDF autodiscovering by WEASYPRINT renderer should now be suffixed by .pdf.html1.3.5           (2020-10-02)Fix ODT images from html, add src in Pictures1.3.4           (2020-09-29)Fix some cases where mimetype can't be guessed1.3.3           (2020-09-29)Fix ODT images display with Word.1.3.2           (2020-09-28)Fix defined police on input text for odt1.3.1           (2020-09-09)Support django 3.11.3.0           (2020-06-09)Implement Weasyprint PDF Template Engine1.2.29          (2020-06-05)Verify if ODT or DOCX file are zippable file to avoid exceptions1.2.28          (2020-04-14)Fix cases when image didn't fit page1.2.27          (2020-04-14)Translate img tag in from_html for odt templates1.2.26          (2020-05-04)Fix deprecation warnings and bad closing files1.2.25          (2020-02-24)Fix span tags with text:span in from_html1.2.24          (2019-12-02)Add rendering of footer and header1.2.23          (2019-11-29)Remove automatically resizeChange value conversion px to odtAdd extension at the end of the generated file1.2.22          (2019-11-25)Change AbstractEngine, inheritate from DjangoTemplates1.2.21          (2019-11-18)Fix context rendering odt.1.2.20          (2019-11-15)fix max_height and max_width1.2.19          (2019-11-14)Add anchor image_url_load, image_loadReplace width and height for image_url_load, image_load by max_width and max_height1.2.18          (2019-11-13)fix odt image inclusion1.2.17          (2019-11-07)Load odt_tags and docx_tags automatically, remove loads to make it worksAdd tag image_url_loadFix odt pictures inside zip1.2.16          (2019-11-04)Allow heading, and text-numbered list in from_html odt tag1.2.15          (2019-10-28)Fix text-input replacement for list inside paragraphs1.2.14          (2019-10-25)Fix text-input replacement for odtAdd custom style for italic and underline text for html filter1.2.13      (2019-10-25)Features:from_html tag filter for odt templates1.2.12      (2019-10-23)Fixes:automatic escape break line in odt template1.2.11      (2019-10-23)Improve:automatic escape break line in odt template1.2.10      (2019-10-09)Improve:Tags are renamedODT image inclusionUpdate:From now on,{% ... %}are also cleaned.1.2.9       (2019-09-24)Other:the template is cleaned before it is filled.1.2.8       (2019-09-24)Optimize:clean methodsAdd:a method that removes incorrect additions in the template tags of the xml fileUpdate:the documentationFix:requirementsOther:AbstractEnginebecomesZipAbstractEngineand allow you to write
custom engines for zip base documents1.2.7       (2019-09-12)Fixes:template generation from different django storage1.2.6       (2019-09-12)Fixes:conditions to determine mimetype template1.2.5       (2019-09-12)Fixes:packaging1.2.4       (2019-09-12)Fixes:Allow mimetype zip for DOCX and ODT1.2.3       (2019-09-11)Fixes:Compatibility with non FileStorageBackend1.2.2UpdatePillow>=5.4.11.2.1requestsis no longer needed.1.2.0From now on, you can specify bold text.1.1.3Image loaders can now take width and height asdxa,px,pt,in,cmandemu.1.1.2Add:A template tag to load images into a docx template (docx_image_loader).1.0.0Add:Docx template engine (template_engines.backends.docx.DocxEngine).Docx template class (template_engines.backends.odt.DocxTemplate).0.0.4Abstract template engine for writing custom engines
(template_engines.backends.abstract.AbstractEngine).Abstract template class for writing custom template classes
(template_engines.backends.abstract.AbstractTemplate).Odt template engine (template_engines.backends.odt.OdtEngine).Odt template class (template_engines.backends.odt.OdtTemplate).A template tag to load images into an odt template (odt_image_loader).