David Cramer's Blog

Jinja: Refactoring Django Support

I've been annoyed for the last 6 months of using Jinja, as I've been working on numerous different Django projects, and I've had to use django-admin.py vs manage.py. The reason for this is simply, that in my settings.py I had used the djangosupport.configure() routine. I tried moving it to other locations, but they didn't seem to work.

So, I've refactored the djangosupport module (based on some previous comments by the Pocoo team), and deprecated the magical djangosupport.configure(). You can now properly import the module via jinja.contrib.djangosupport and use all of the same methods that were available via django.contrib.jinja.

The patch also includes handler404, handler500, and direct_to_template methods.

If you're interested, here is the diff and a matching hg bundle. You can also view the ticket on Jinja's Trac instance.