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.0

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.0.0.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

File details

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

File metadata

File hashes

Hashes for django_safe_template_engine-1.0.0.tar.gz
Algorithm Hash digest
SHA256 e8475ea2c5388458106e32a8891e82964038191309dfa3cfddecfe1b38556be5
MD5 115a209fefca47ab95f88d2fd45813ab
BLAKE2b-256 4bc2156c984f0da76aea967bc49ba81fe8b62464fd14eea9e454addf8ae74b6b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_safe_template_engine-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 97c4d20216847ebe3cb51e1e78883a2fd5c4beead95bd35b98e1115370094aba
MD5 ec801501b991a30eaeaccb203b6d4b55
BLAKE2b-256 dcf75a8b9cbbe72fb0f45c379f0b2c0b516a895d97c934f93c4f786b68526be4

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