Skip to content

Instantly share code, notes, and snippets.

@phillipcutter
Created July 6, 2020 01:08
Show Gist options
  • Save phillipcutter/b0c379487f63d7464a19f72f4afd6052 to your computer and use it in GitHub Desktop.
Save phillipcutter/b0c379487f63d7464a19f72f4afd6052 to your computer and use it in GitHub Desktop.
Replace Django Absolute Paths for Static Paths with Regex Find & Replace

Replace Django Absolute Paths for Static Paths with Regex Find & Replace

Find: \"\.\.\/\.\.\/\.\.\/static\/([0-9A-Za-z._\-\/]+)\" Replace: "{% static "$1" %}"

Works with PyCharm and likely other Jetbrains IDEs

@phillipcutter
Copy link
Author

Don't forget to {% load static %}!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment