Question: Hi I'm trying to get Python Flask to display a image for my local web server. The image is just called projectintro.jpeg but when running

Hi I'm trying to get Python Flask to display a image for my local web server. The image is just called projectintro.jpeg but when running the code below I get the error:

"GET / HTTP/1.1" 404

Please help me fix the code below to display a image thank you

from flask import Flask #import flask from flask import send_file app = Flask(__name__) @app.route('/get_image') def get_image(): filename = 'projectintro.jpeg' return send_file(filename, mimetype='image/gif') if __name__ == '__main__': app.run(host='127.0.0.1', port=80)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!