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

Using a regular expression, in PyCharm:


"{{ 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: Logo

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

Facebook photo

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

Connecting to %s