I created templates directory and i put my home.html over there<html><body><img src="static/images/logo.jpg" alt="My Logo"/></div></body></html>I created static folder and i put my image logo.jpg over there
Because static is a folder on the root of your website, try putting
a slash in front of static; for example,
Hope this helps. :-)
Sincerely,
Carl
--You received this message because you are subscribed to the Google Groups "Django users" group.To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.To post to this group, send email to django...@googlegroups.com.Visit this group at https://groups.google.com/group/django-users.To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/e3703e83-01d4-4412-9227-c82147262571%40googlegroups.com.For more options, visit https://groups.google.com/d/optout.
Hello,
<img src="static/images/logo.jpg" alt="My Logo"/>
This is probably missing a slash before "static"; it should be like this:
<img src="/static/images/logo.jpg" alt="My Logo"/>
But a better way is this:
{% load static %}
...
<img src="{% static 'images/logo.jpg' %}" alt="My Logo"/>
If you are on production rather than development, see also this: https://djangodeployment.com/2016/11/21/how-django-static-files-work-in-production/
Regards,
Antonis
Antonis Christofides http://djangodeployment.com