<img> doesn’t work is it my problem

Uhh is img in html used like

<img src='(path)' alt='Desc here'>

If yes how is my code not working?
Webpage link:

Idk in my view it shows like this

If there is any problem in my code(the html code is in line 169)plz help

Edit: a herf is fixed thank you

Hello, I always encounter this problem. Try renaming the image to something else. If it doesn’t work, try deleting it and reuploading it.

Hi @TaokyleYT! Although I’m not familiar with flask, I think this is a problem based on paths.
On line 124 of your code, you have:

pics = f"pics/{pic}"

Which may seem to do the trick, however it doesn’t. The reason may be because it is not searching from the correct folder. You can try f"./pics/{pic}" to search from the current directory, or use f"/pics/{pic}" to search from the root folder.

Hope this helps! :slight_smile:

Oh it’s the code lol, I thought it was that common replit glitch

It could be, I’m not familiar with the replit glitch.

Nope ./pic/{pics} doesn’t work
Also in line 125 to 127 is to check if the path exists and accessible, which the path in 124 passed it so I don’t think it is the problem of the path

Also I found another problem, similar it is also html code not working but for “a herf”

Your problem is (at least in part) that there is no HTML herf. It is href. So please use <a href="URL"> instead of herf.

Thanks the href is fixed, but the img bug is still nonsense lol

Your links don’t seem to work? Mind editing them to fix this?

Oh just discovered that a href doesn’t work here, just click the question mark I guess

Which page is having issues for you, i have visited most of the links and all of them work. you might have a content-blocker restricting your images.

This is probably a cache issue. A new user entering the site can view the images just fine. You can try restarting Google Chrome or delete cache data from your website.

Edit: nvm found out you put herf instead of href. But if you do encounter any image issues with the correct href, then yeah it’s probably cache.

1 Like

Hello there, your problem may be cache. If not I would suggest ensuring that the address to your image is legitimate. Try debugging by moving your image to the home directory (without it being inside of folders), and modify the HTML code to reference it as just “image.png” instead of “folder/image.png”. (As an example).

Well clearing cache and letting them in the same dir as main.py doesn’t work, any idea?

Do you have any parental controls or restrictions on your phone or PC?

The path should not be in ()

Or so I think…. I’m not so sure about it.

Welcome to the community, however I don’t know what () you are talking about

I believe they misunderstood this:

In your original post: