Skip to content

Instantly share code, notes, and snippets.

@wolph
Created September 23, 2015 10:18
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 wolph/8d06648181cfa036b855 to your computer and use it in GitHub Desktop.
Save wolph/8d06648181cfa036b855 to your computer and use it in GitHub Desktop.
Regular expression (Perl pie) to search and replace Django STATIC_URL with the static (from staticfiles) templatetag
perl -pi -e 's/"\{\{\s*STATIC_URL\s*\}\}\/?([^"]+)"/"{% static \x27$1\x27 %}"/g' templates/***/*.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment