Skip to content

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

License

Notifications You must be signed in to change notification settings

jmfederico/jinja2-python-version

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔔 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()

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages