Skip to content

Instantly share code, notes, and snippets.

@jemerick
Created April 20, 2010 17:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jemerick/372797 to your computer and use it in GitHub Desktop.
Save jemerick/372797 to your computer and use it in GitHub Desktop.
# Load custom template tags in all templates
# Custom template tags that you use all over your templates can be auto loaded. Just add the following in a module that is # loaded (i.e. your urlconf if you want the template tags to be loaded for the whole project)
from django import template
template.add_to_builtins('project.app.templatetags.custom_tag_module')
# relative paths
import os.path
TEMPLATE_DIRS = (
os.path.join(os.path.dirname(__file__), "templates"),
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment