No project description provided
Project description
Jinja2 Script
Introduction
In ERB, custom functions can be written in the template. However with jinja2, the functions should be written in python, and must be included in the rendering environment.
Use Script Block
{% script modulename %}
# Your Python Code that should be in .py
{% endscript %}
Define your python codes in script block. This is compiled before actual run starts.
To use compiled block, do it as following:
{{module.functions_you_defined()}}
{{module.values_you_defined()}}
{{module.function_with_arguments(1)}}
{{module.function_with_arguments_at_render(x)}}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for jinja_script_block-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2f2d9bd07801bf8d8b480bc880bf6d4c705a7d9b16d34ceaa21b331b2427d5d |
|
MD5 | 9675e4e16e6049dd68037ff16524e0db |
|
BLAKE2b-256 | 6f0fa655f1f79bebf8e7e67b1af124ae6f0c378f9dd71d9dd00b2c6a9f2e735f |