-1

I have a folder of pictures that each belong to a post in a blog, with each picture named after the id of the post with the .png extension.

When the page is created, the URL requested for the pictures is correct, but weirdly they are requested as text/html, and the page returns 404.

The pictures are not found (404)

The pictures are requested as text/html

An <img> with the src set to the correct source of the pictures

1 Answers1

1

Try referencing the image paths explicitly, replace static with path/to/uploads.

<img src="{{ url_for('static', filename = 'post.id.jpg') }}">  
simanacci
  • 2,197
  • 3
  • 26
  • 35