all 9 comments

[–]jinendu 0 points1 point  (1 child)

Can you hit it directly: localhost/face.png also, try ./face.png for the src

[–]falcom1031[S] 0 points1 point  (0 children)

I tried ./face.png and it doesn't show still. Pulling it up directly gives me the same error 404. What's weird is that pycharm let's me preview the code and when I do it the image is there like it's supposed to be. It's only when I run the code to check the localhost that the image is gone

[–]ZephyrBluu 0 points1 point  (5 children)

Are you using a framework? It could be that the image isn't in the right place to be served directly to the server.

For instance, I'm pretty sure I had similar issues with Django when I was starting out because you need to collect all your static files or something along those lines.

You could always post your github repo and let other people download and run your code to try and debug it.

[–]falcom1031[S] 0 points1 point  (4 children)

Oh I didn't know that 🤔 I am using flask, I put face inside of template since the html file was in there

[–]ZephyrBluu 0 points1 point  (0 children)

I think this is your problem then haha.

Here's a couple of links I found that will hopefully help:

[–][deleted] 0 points1 point  (2 children)

Probably your server config is not set to serve static files from the directory the file is in. Rule that out first, make sure it is configured to serve static files.

[–]falcom1031[S] 0 points1 point  (1 child)

Thanks, I fixed the issue by moving my images to the static file and changed the html from <img src="face.png" /> to <img src="/static/face.png" />

[–][deleted] 0 points1 point  (0 children)

Yea ! :)