1. Skip to navigation
  2. Skip to content

Entries tagged “templates”

Django Templates in Javascript

written by Michael Trier, on Feb 7, 2008 11:10:00 PM.

Neil Roberts implemented the Django template language in JavaScript. Pretty cool stuff. Find out more at Ajaxian

Common Template Tags

written by Michael Trier, on Aug 7, 2007 12:04:00 AM.

I’m still enjoying the nuggets of goodness in the Django Master Class slides. I love this little tidbit:

from django import template
template.add_to_builtins(“myproject.templatetags.switchcase”)

If you have custom template tags that you want to make available in every template, put the above bit of code in a top level file that will get loaded on startup, such as __init__.py. I like it.