Django template utilities
This is a small library of template tags and other template-related utilities for use with Django; while Django does a great job in general of helping developers avoid repetitive code, there are still a few things which tend to be useful or even needed in many different types of projects, so this application aims to genericize and bundle many of them into one reusable package.
Downloading and installing
The easiest download method is a Subversion checkout; all of the code is maintained in a Subversion repository, and checking the code out from the repository makes it easy to handle updates. To download and install, simply execute this command from a directory that's on your Python path:
svn co http://django-template-utils.googlecode.com/svn/trunk/template_utils/
This will create a directory called template_utils, and download the current code into it. From there, you should be able to add template_utils to the INSTALLED_APPS setting of any Django project and have it work. This application provides no models, so you don't need to run manage.py syncdb before using it.
Alternatively, you can download a packaged version of the entire application and use Python's distutils to install it:
wget http://django-template-utils.googlecode.com/files/template_utils-0.1.tar.gz tar zxvf template_utils-0.1.tar.gz cd template_utils-0.1 python setup.py install
Currently, five main components are bundled into template_utils:
- Template tags for generic content retrieval.
- Template tags for robust comparison operations.
- Template tags for retrieving public comments (for when a comment-moderation system is in use).
- A generic text-to-HTML conversion system with template filter support.
- A system for generating template context processors which can add arbitrary settings to template contexts.