This is the more normal way of doing this is to have a
static
folder for images,CSS,Js...ectimage_show\ |-- app.py templates\ |-- index.html static\ images\ |-- Joker.pngapp.py
from flask import Flask, render_template, url_for app = Flask(__name__) @app.route('/') def index(): return render_template("index.html") @app.route('/about') def about(): pass if __name__ == '__main__': app.run(debug=True)index.html
<!DOCTYPE html> <html lang="en"> <head> <title>About</title> </head> <body> This is our base template :) <BR> <!-- Two ways --> <img src="static/images/Joker.png"> <img src="{{ url_for('static', filename='images/Joker.png') }}" </body> </html>