Skip to main content

A Jinja2 extension that adds django version to templates.

Project description

https://badge.fury.io/py/jinja2-python-version.svg https://travis-ci.org/jmfederico/jinja2-python-version.svg?branch=master

A Jinja extension 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 }}")

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

jinja2-django-version-1.1.2.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

jinja2_django_version-1.1.2-py2.py3-none-any.whl (3.4 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file jinja2-django-version-1.1.2.tar.gz.

File metadata

  • Download URL: jinja2-django-version-1.1.2.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.16 CPython/3.7.4 Darwin/18.7.0

File hashes

Hashes for jinja2-django-version-1.1.2.tar.gz
Algorithm Hash digest
SHA256 b216c1c6996f87ef6e906b4f396d52202f68dc7609ea01435e185d677e285326
MD5 1c46a4cdcef0157288e4b02a29b7533d
BLAKE2b-256 a9cb09ddbc368ad7575ce35e0d9b4a207ca626bc73ebf674a3f9568b24ab4a8b

See more details on using hashes here.

File details

Details for the file jinja2_django_version-1.1.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for jinja2_django_version-1.1.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 fa18412e35b4279a154703372c9a862c414f6efa43017352dec3acfc2e54a61b
MD5 b82199a5694e3d7b34bd834822e3ab2f
BLAKE2b-256 d75fc6cc0456dfdc57ae671766d981036eb171a42734c5a1283a059f0779fb95

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page