Plain is headed towards 1.0! Subscribe for development updates →

Templates

Render HTML templates using Jinja.

Templates are typically rendered in TemplateViews, but you can also render them directly to strings for emails or other use cases.

from plain.templates import Template


Template("comment.md").render({
    "message": "Hello, world!",
})

Template files can be located in either a root app/templates, or the templates directory in any installed packages.

Customizing Jinja

1from .core import Template, TemplateFileMissing
2
3__all__ = [
4    "Template",
5    "TemplateFileMissing",
6]