Fix templates to work with django 1.5.

This is required for the url template tag in django 1.5. I believe it's backwards compatible too but I haven't tested it with earlier versions.