Django Template Image Won't Load (repost)
Image wan't load.I see o broken image icon.I use the static tag. I also tried giving the absolute path and never worked.I used the alt tag but still i can only see the broken image
Solution 1:
Try either
<img src="{{ STATIC_URL }}images/logo.png" alt="alternative text" />
or fixing your quotes
<img src="{% static 'images/logo.png' %}" alt="alternative text" />
and fixing your settings
STATICFILES_DIRS = ('assets', r'C:\Users\@#@#@#@#@\workspace\project\static'),
or
STATICFILES_DIRS = ('assets','C:\\Users\\@#@#@#@#@\\workspace\\project\\static'),
Solution 2:
It's worth asking whether or not you've used Django's collectstatic
method after including the image in your assets folder.
Post a Comment for "Django Template Image Won't Load (repost)"