A Jinja2 extenstion that adds django version to templates.
Project description
A Jinja extenstion that creates a global variable with Django version information for your Jinja2 templates:
Usage
$ pip install jinja2-django-version
from jinja2 import Environment
env = Environment(extensions=['jinja2_django_version.DjangoVersionExtension'])
# 2.0
template = env.from_string("{{ django_version }}")
# 2.0
template = env.from_string("{{ django_version.minor }}")
# 2
template = env.from_string("{{ django_version.major }}")
# 2.0.2
template = env.from_string("{{ django_version.micro }}")
# (2, 0, 2, 'final', 0)
template = env.from_string("{{ django_version.tuple }}")
template.render()
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
Close
Hashes for jinja2-django-version-1.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 68f20dd98829f00a4c714c790132a76be3537346ac2e20c0c90eb533abbc8dba |
|
MD5 | 871dd200c1d16756205e963f3f18315b |
|
BLAKE2b-256 | 2ac45f04f5c3cfa20cd4ee23ffc02be3e1bf69182eaa3d08513b7d95c81395d3 |