2๐
โ
Try doing something like this is your settings.py:
MEDIA_SERVER_URL = 'http://www.example.com/'
MEDIA_URL = os.path.join(MEDIA_SERVER_URL, 'images/')
and then do
src="{{ MEDIA_URL }}{{ example.image.url }}"
Also check for permissions:
- Media Directory (/home/nicpon/Dokumenty/aplikacje/images/): Should allow read by your webserver (eg: chgrp www-data images)
- Your webserver should be configured to handle media serving appropriately. Ideally a separate media server can be used, but you should check the respective URLs if you are having django serve the media (as seems to be the case from your urls.py)
๐คPriyeshj
Source:stackexchange.com