Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started