Skip to content

Instantly share code, notes, and snippets.

@alexanderattar
Created October 16, 2014 19:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexanderattar/1dcababd74e5ca4a5091 to your computer and use it in GitHub Desktop.
Save alexanderattar/1dcababd74e5ca4a5091 to your computer and use it in GitHub Desktop.
converts url tags to the new style format in django 1.5 and up. i.e. {% url whatever args %} -> {% url 'whatever' args %}. run it from your templates directory
find . -type f -print0 | xargs -0 sed -i '' -e "s/ url \([^\" >][^ >]*\)/ {% url '\1'/g"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment