Last active
May 13, 2019 15:16
-
-
Save erny/19ee461d2f11a8777a26e656934fdad1 to your computer and use it in GitHub Desktop.
Replace django STATIC_URL with {% static %} template tag.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# STATIC_URL must have one space before and one after (or change regex below). URLs must be enclosed with double quotes. | |
rgrep '{{ STATIC_URL }}' . -l | xargs perl -pi -e 's/"\{\{ STATIC_URL \}\}(.*?)"/"{% static '"'"'\1'"'"' %}"/' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment