I really hate doing all this garbage manually, so I wrote a sed script to do this for me. First make sure you have a backup, then run this in your templates directory:
find . -type f -print0 | xargs -0 sed -i 's/{% url \([^" >][^ >]*\)/{% url "\1"/g'
It will look through all your template files and replace this:
{% url something.else foo bar %}
with this
{% url "something.else" foo bar %}
Be careful, I was a little lazy about this, it may break on some designs. However, it will be easier to look for errors in diff than to do it manually.
Stephen Fuhry Mar 12 '13 at 23:05 2013-03-12 23:05
source share