Making templatetags global to all templates

1
2
3
4
5
6
# <mysite>/globaltags/__init__.py

from django.template import add_to_builtins
add_to_builtins('globaltags.pyif')
add_to_builtins('globaltags.expr')
add_to_builtins('globaltags.dbinfo')

More like this

  1. Template tag to dump database query info by pryankster 6 years, 2 months ago
  2. decorator to add author to extra_fields in snippets 635 by gehel 5 years, 1 month ago
  3. strip_tags like php one by homm 3 years, 1 month ago
  4. (Modified/Improved) MultiQuerySet by joonas 4 years, 6 months ago
  5. Template range filter by zalun 4 years, 3 months ago

Comments

gsf0 (on August 27, 2007):

Took me a second to realize I still had to add '<mysite>.globaltags' to INSTALLED_APPS, then it worked like a charm! Thanks.

#

(Forgotten your password?)