0

I am trying to add the image to my page:

<td>
     <img src="{{ url_for('images', filename='test.png') }}">Test
 </td>

But I am getting this error when I run my flask server:

raise BuildError(endpoint, values, method)
BuildError: ('images', {'filename': 'test.png'}, None)

I have added test.png in images directory.

N34
  • 2,153
  • 2
  • 11
  • 7
  • Do you have a route named 'images'? Or did you make images a static path? You need to post more code from your application, at least all the @app.route lines and how you're instantiating the Flask object. – Steven Kryskalla Feb 24 '15 at 20:11
  • possible duplicate of [Flask url\_for Referencing Static Files](http://stackoverflow.com/questions/16351826/flask-url-for-referencing-static-files) – Jimilian Feb 24 '15 at 20:12

1 Answers1

0

I'm guessing your images folder is not inside the static folder. If you move it inside your static folder and reference it as such

{{url_for('static',filename='images/test.png')}}

it should work

Shankar ARUL
  • 12,642
  • 11
  • 68
  • 69