Skip to main content
https://github.com/zopefoundation/DocumentTemplate/actions/workflows/tests.yml/badge.svg https://coveralls.io/repos/github/zopefoundation/DocumentTemplate/badge.svg?branch=master Current version on PyPI Supported Python versions

DocumentTemplate

This package implements the original Document Templating Markup Language (DTML). It uses custom SGML tags to implement simple programmatic features, such as variable replacement, conditional logic and loops.

Inside Zope environments page templates and TAL have superseded DTML for most use cases.

Changelog

5.4 (2026-08-20)

  • Add support for Python 3.15.

  • Switch to PyPI Trusted Publishing.

5.3 (2026-02-25)

  • Reverted builtins shadowing fix from 5.2, it was causing other issues.

5.2 (2026-02-23)

  • Prevent builtins shadowing in DTML Var. (Zope#1285)

5.1 (2026-01-19)

  • Move package metadata from setup.py to pyproject.toml.

  • Fix Zope test failures accessing sequence wrappers introduced in #76 from untrusted code. (#81)

5.0 (2025-11-27)

  • Add support for Python 3.13, 3.14.

  • Drop support for Python 3.7, 3.8, 3.9.

  • Support lazy batching again, support general iterators (#75)

4.6 (2023-11-13)

  • Add official support for Python 3.12.

4.5 (2023-09-18)

  • Add preliminary support for Python 3.12rc1.

  • Be more resilient on sorting if the getter returns None. (#72)

4.4 (2022-01-12)

  • Drop support for Python 3.6.

4.3 (2022-12-21)

  • Fix restructured-text format specification. Tests were silently skipped.

4.2 (2022-12-16)

  • Fix insidious buildout configuration bug for tests against Zope 4.

  • Add support for Python 3.11.

4.1 (2022-09-20)

  • Set the tree-s cookie for dtml-tree tags with SameSite=Lax. The tree tag never set this attribute. That causes modern browsers to show warnings in the browser console and break tree displays in the future. See https://hacks.mozilla.org/2020/08/changes-to-samesite-cookie-behavior/ for information about the SameSite cookie attribute and why its handling in browsers is changing.

  • Add support for Python 3.10.

  • Drop support for Python 3.5.

4.0 (2020-11-12)

  • Make ustr.ustr Python 3 compatible (Zope#921)

  • Add support for Python 3.9

  • Restore sql_quote behavior of always returning native strings (#54)

  • Fix broken tree tag (#52)

  • Drop support for Python 2.

  • Eventually drop BBB code leading to a deprecation warning in version 3.2+. (#42)

  • Update isort to version 5.

3.2.2 (2020-02-04)

  • de-fang sql_quote even more as quoting is too database-specific. (#48)

3.2.1 (2020-02-03)

  • prevent a really strange AccessControl test failure when running Zope’s alltests script by importing deprecated names from zope.sequencesort.ssort instead of sequence/SortEx.py in sequence/__init__.py

3.2 (2020-02-03)

  • no longer escape double quotes in sql_quote - that breaks PostgreSQL (#48)

  • Added DeprecationWarnings for all deprecated files and names (#42)

  • Import sorting done like Zope itself

  • Applied extended linting configuration similar to Zope’s own

3.1 (2020-01-31)

  • Escape more characters in sql_quote. Taken over from PloneHotfix20200121.

3.1b2 (2019-05-16)

  • Fix broken handling of SyntaxError under Python 3

3.1b1 (2019-05-13)

  • Don’t call HTTPExceptions that are looked up in TemplateDicts

3.0 (2019-05-09)

Changes since 2.13.2:

Breaking changes

  • Replace C code with a pure-Python implementation.

  • Remove VSEval module. Please use DT_Util.EVal now.

  • Remove DTtestExpr module. It contained nothing useful.

  • Remove support for string exceptions in <dtml-except>. (#29)

Features

  • Add support for Python 3.5, 3.6, 3.7, 3.8.

  • Make the rendering encoding configurable to fix rendering on Zope 4. (#43)

  • Add __contains__ support to DocumentTemplate.TemplateDict.

Bug fixes

  • Only decode input in html_quote when needed under Python 3 (Products.PythonScripts#28 <https://github.com/zopefoundation/Products.PythonScripts/issues/28>_)

  • Make sure all JSON-serialized data is text data and not bytes. (#45)

  • Fix regression with exception handling in <dtml-except> with Python 2. (#25)

  • Stabilized TreeTag rendering for objects without _p_oid values. (#26)

  • Fix bugs with <dtml-in>:

    • Raise proper error if prefix is not simple.

    • Fix complex multisort in Python 3.

    • Fix iteration over list of tuples in Python 3.

  • Ensure html_quote is being applied to content.

2.13.2 (2011-12-12)

  • Restrict the available functions in DocumentTemplate.sequence to public API’s of zope.sequencesort.

2.13.1 (2010-07-15)

  • LP #143273: Enable the dtml-var modifiers url_quote, url_unquote, url_quote_plus and url_unquote_plus to handle unicode strings.

2.13.0 (2010-06-19)

  • Released as separate package.

Release files for DocumentTemplate 5.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for DocumentTemplate 5.4
File Size Uploaded
documenttemplate-5.4.tar.gz 72.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for DocumentTemplate 5.4
File Interpreter ABI Platform
documenttemplate-5.4-py3-none-any.whl Python 3 none any Details

Total release size: 160.8 kB

Release files / documenttemplate-5.4.tar.gz

Download URL documenttemplate-5.4.tar.gz
Size 72.2 kB
Tags Source
SHA-256 checksum
How to use checksums
856f9cafe783d5b0f09c14aeb32e5439400110ddf0113e1ce3d0f54e884b7c4e
BLAKE2b-256 checksum
How to use checksums
7ad8361496e1381d186ab1df44316322a0a17975ac0727422f13ded27c9d5e59
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 20, 2026.

Transparency log

Release files / documenttemplate-5.4-py3-none-any.whl

Download URL documenttemplate-5.4-py3-none-any.whl
Size 88.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c6677345422f05e25318530b9c6d28df54e71728a8c29d279e6937e153ec41e2
BLAKE2b-256 checksum
How to use checksums
c368209cdac62bb11962c042ab985d9e1eff070ead16f128f4d96af83bc6d35e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 20, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

5.4 This release

2 release files

5.3

2 release files

5.2

2 release files

5.1

2 release files

5.0

2 release files

4.6

2 release files

4.5

2 release files

4.4

2 release files

4.3

2 release files

4.1

2 release files

4.0

2 release files

3.4

2 release files

3.3

2 release files

3.2.3

2 release files

3.2.2

2 release files

3.2.1

2 release files

3.2

2 release files

3.1

2 release files

3.0

2 release files

2.13.6

1 release file

2.13.5

1 release file

2.13.4

1 release file

2.13.3

1 release file

2.13.2

5 release files

2.13.1

5 release files

2.13.0

5 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page