examples/flask/4/app.py
from flask import Flask, request, render_template, url_for
app = Flask(__name__)
 
@app.route("/")
def main():
    return render_template('main.html')

@app.route("/other")
def other():
    return render_template('other.html',
        img_path = url_for('static', filename='img/python.png'))
examples/flask/4/templates/main.html
<h1>Main page</h1>
<img src="/static/img/python.png">
<p>
<a href="/other">other</a>
examples/flask/4/templates/other.html
<h2>Other page</h2>
img_path: {{ img_path }}
<p>
<img src="{{ img_path }}">
<p>
<a href="/">main</a>