Reputation: 27
I have a problem with my project. Django can not open images, but css and javascript are working. In my Home Page everything is OK, but in pages like "about" and "contact" the images are not visible.
"GET /about/images/image_4.jpg HTTP/1.1" 404 2702
Upvotes: 1
Views: 54
Reputation: 1233
As the log shows, the GET request for the image at /about/images/image_4.jpg throws a 404 code. This means that Django wasn't able to locate the file you specified.
Assuming that you are getting the image as a static file, then note that the root static directory for static files is /static, and then Django would be searching in: /static/about/images/image_4.jpg
For more info about static files refer to: https://docs.djangoproject.com/en/2.2/howto/static-files/
Either way, as you stated that css and html files are loaded successfully then the most probable thing is that the path you provided is wrong.
If this doesn't solve the problem, please expand the information about your project.
Hope it helps!
Upvotes: 1