python flask display image on a html page [duplicate]

I have created people_photo in static folder and placed an image named shovon.jpg. From the application.py I passed the image as variable to template and showed it using img tag in the template. In application.py: from flask import Flask, render_template import os PEOPLE_FOLDER = os.path.join(‘static’, ‘people_photo’) app = Flask(__name__) app.config[‘UPLOAD_FOLDER’] = PEOPLE_FOLDER @app.route(“https://stackoverflow.com/”) @app.route(‘/index’) def … Read more

Multiple parameters in Flask approute

The other answers have the correct solution if you indeed want to use query params. Something like: @app.route(‘/createcm’) def createcm(): summary = request.args.get(‘summary’, None) change = request.args.get(‘change’, None) A few notes. If you only need to support GET requests, no need to include the methods in your route decorator. To explain the query params. Everything … Read more