Skip to content

Latest commit

 

History

History
53 lines (33 loc) · 1.45 KB

README.rst

File metadata and controls

53 lines (33 loc) · 1.45 KB

🔔 PROJECT STATUS 🔔

Life has taken me to now work in GO, and do not have the time to actively maintain this project.

Which means this project is looking for new maintainer, please open an issue and postulate yourself if interested.

Jinja2 Python Version

A Jinja extension that creates a global variable with Python version information for your Jinja2 templates:

Compatible with Jinja2 versions 2.x and 3.x.

Usage

$ pip install jinja2-python-version
from jinja2 import Environment

env = Environment(extensions=['jinja2_python_version.PythonVersionExtension'])

# 3.6
template = env.from_string("{{ python_version }}")

# 3.6
template = env.from_string("{{ python_version.minor }}")

# 3
template = env.from_string("{{ python_version.major }}")

# 3.6.4
template = env.from_string("{{ python_version.micro }}")

template.render()