Skip to main content

Jinja2 extension to handle git-specific things

Project description


This pligin is used to render commit hash in jinja2 templates. We are using it to render our template version in cookicutter:


Add it as an extension for jinja2 or cookiecutter.

And then inside a template:

from jinja2 import Environment

env = Environment(extensions=['jinja2_git.GitExtension'])
template = env.from_string('Commit is: {% gitcommit %}')
# => Commit is: c644682f4899d7e98147ce3a61a11bb13c52b3a0


$ pip install jinja2-git

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

jinja2-git-0.1.0.tar.gz (3.8 kB view hashes)

Uploaded source

Built Distributions

jinja2_git-0.1.0-py3-none-any.whl (3.9 kB view hashes)

Uploaded py3

jinja2_git-0.1.0-py2.py3-none-any.whl (3.9 kB view hashes)

Uploaded py2 py3

jinja2_git-0.1.0-py2-none-any.whl (3.9 kB view hashes)

Uploaded py2

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page