Flask web page cannot find image file
The way your program is currently written, the image will be visible if you reorganize the project layout like this:
project├── app.py├── static│ └── image1.jpg└── templates └── photo1.html
The fact that you want to use send_static_file
to display photos suggests that photos are static resources. If that's the case, then it would be better to:
1) Move image1.jpg
to static/photos/image1.jpg
2) Change the template like this:
<p> <img src="{{url_for('static', filename='photos/image1.jpg')}}"></p>
3) Drop the app.add_url_rule('/photos/<path:filename>', ...)
in app.py