首页 > 解决方案 > 我的网页正在使用烧瓶服务器加载图像

问题描述

即使它们位于静态文件夹中,我也无法在网页上加载图像。

我也尝试提供图像的路径,但无法加载

<img class="w3-image" src="{{ url_for('static', filename='architect.jpg') }}" alt="Architecture" width="1500" height="800">

蟒蛇代码:

from flask import Flask,render_template
app = Flask(__name__)

@app.route('/')

def hello_name():
    return render_template('index.html')

if __name__ == '__main__':
    app.run(debug=True)

标签: htmlimageflaskserver

解决方案


推荐阅读