[Django]-Django – What is different {% static %} and /static/?

4πŸ‘

βœ…

The problem with hardcoded URLs <img src="/static/img/person.png" /> is that if in future you want to change static URL you have to go through all files to replace it with newer one, and usually in production sometimes we want to use CDN to serve static content and that is not served via /static/.

For the other difference between {% static %} and {{ STATIC_URL }} check this answer.

πŸ‘€Aamir Rind

Leave a comment