Skip to main content

A Django template engine to render untrusted template code

Project description

GitHub Actions build status

Django Safe Template Engine

Django template engine to render untrusted template code

Requirements

  • Python 3.8 to 3.11
  • Django 3.2 (officially supported in technical tests, all built-in template tags and filters reviewed)

Available tools

Template engine:

from django.template import Template
from django_safe_template_engine.engine import SafeTemplateEngine

safe_engine = SafeTemplateEngine()
Template(source, engine=safe_engine)

Validator:

from django_safe_template_engine.validators import validate_safe_engine_template_syntax

template_code = '{% include "hacked.html" %}'
validate_safe_engine_template_syntax(template_code)

Trusted built-ins

The following tags and filters are allowed by this template engine.

Trusted tags

Trusted filters

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_safe_template_engine-1.1.0.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file django_safe_template_engine-1.1.0.tar.gz.

File metadata

File hashes

Hashes for django_safe_template_engine-1.1.0.tar.gz
Algorithm Hash digest
SHA256 27c54ac534d3250b49c5f24e078a3a956958cc88744e8576deb36d3f99c5c21b
MD5 88da37325a4dd21ed65c8e1cb46eb5d6
BLAKE2b-256 a039bfeb0296af606926b7a3bd5c925eaa07700d898280cce9e1fd45c70e79ae

See more details on using hashes here.

File details

Details for the file django_safe_template_engine-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_safe_template_engine-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ebd27d985844eaacae6eab366df97e0631bed28e61990d4571b51ebc76f065ac
MD5 6bc7fe6c44ea6f7c18a813804f38ac59
BLAKE2b-256 8c3b6ac8e711f9d75d36065dfd2a8f0527a0105c7784c1155d7304a251337bdf

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page