I'm new to Django, I know that to display an image I should define MEDIA_URL
in the settings.
But when I tried to remove it and use the {{ img.url }}
the images are still readable and the browser can see it and display it. The question is does this mean that the MEDIA_URL
does not import in displaying images, and why did we declare it if we can use img.url
instead.
No images should not be viewable if you remove
from settings.py
and
If they are, it is probably just because your browser cached the images.
Try doing CNTL + SHIFT + DEL while in your browser and clearing the cache. Then reload your django web page.