Django: Moving from MEDIA_URL to the {% static %} tag

Using a regular expression, in PyCharm:

Search:

"{{ MEDIA_URL }}/(.*?)"

Replace with:

"{% static "$1" %}"

This also is a note that that in PyCharm, the way to reference capture groups in the replace expression, is the dollar sign.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s