Ask coding questions

← Back to all posts
How can I access image files in Flask?
smlamont (2)

I am having trouble displaying an image file in Flask. I have it in the static folder and am trying to access it with the following HTML command:

<img src="static/logo.jpg" alt="Madlibs Logo" />

This matches the Properties for the file. But when I run it I get the 404 error message and it displays my alt text. When I copy and paste the copy-link URL for the file (really long!) it displays properly.

Code is here. I am trying to access the file from template/home.html

PikachuB2005 (10)

Did you figure it out?