django-template-analyzer 1.1.0

Extract template nodes from a Django template

  Add it to your Download Basket!

 Add it to your Watch List!

0/5

Rate it!

What's new in django-template-analyzer 1.1.0:

  • Added Django 1.4 compatibility.
Read full changelog
send us
an update
LICENSE TYPE:
BSD License 
USER RATING:
UNRATED
  0.0/5
DEVELOPED BY:
Diederik van der Boor and Django CMS d...
HOMEPAGE:
github.com
CATEGORY:
ROOT \ Internet \ HTTP (WWW)
django-template-analyzer is a Django app that offers an API to analyze the Django template structure. It can be used to find nodes of a particular type, e.g. to do automatic detection of placeholder tags.

API example

from template_analyzer.djangoanalyzer import get_node_instances
from mycms.templatetags.placeholdertags import Placeholder

template = get_template("mycms/default-page.html")

placeholders = get_node_instances(template, Placeholder)
placeholder_names = [p.get_name() for p in placeholders]


Installation

First install the module, preferably in a virtual environment. It can be installed from PyPI:

pip install django-template-analyzer

Or the current folder can be installed:

pip install .

Last updated on May 7th, 2012

requirements

#template analyzer #Django template #Django #template #analyzer #nodes

Add your review!

SUBMIT