Skip to content

Instantly share code, notes, and snippets.

@basola21
Created May 9, 2023 08:21
Show Gist options
  • Save basola21/702d8d52bd7227b50bc08552ea547de0 to your computer and use it in GitHub Desktop.
Save basola21/702d8d52bd7227b50bc08552ea547de0 to your computer and use it in GitHub Desktop.
Regex for the static files in djnago template
Find what:
(href|src)="([a-zA-Z0-9/.-]+[^.html])"
Replace with:
$1=\"{% static 'assets/$2' %}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment