html - 我的网页正在使用烧瓶服务器加载图像
问题描述
即使它们位于静态文件夹中,我也无法在网页上加载图像。
我也尝试提供图像的路径,但无法加载
<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)
解决方案
推荐阅读
- javascript - 为什么这个变量总是返回 null ?角服务
- java - 试图实现堆栈和括号匹配问题,但无法找出一些语义错误
- rest - IBM Watson Discovery - 如何列出上传的文档?
- java - 尝试在 java 中初始化多维数组时收到 NullPointerException 错误
- c# - 尝试在一段时间内自动滚动到屏幕底部
- android - 使用 geofire 仅检索 3 英里内的用户列表
- reactjs - 我没有在组件的参数上添加功能。我应该怎么修?反应
- f# - Npgsql (PostgreSQL) F# 示例无法使用未解析的程序集进行编译
- kubernetes - Kubernetes:如何从另一个服务/pod 扩展部署?
- ruby-on-rails - Trix 编辑器无法在 Rails 中正常工作