Support Django 1.5 in templates

Also add a useful management command