您好,我正在尝试添加图像到我的网络应用程序上的谷歌应用程序引擎使用
<img src=''>此目录中的我的html页面
/templates/control-panel/index.html和我的app.yaml文件
version: 1
runtime: python27
api_version: 1
threadsafe: true
handlers:
- url: /templates/control-panel/assets/img
static_dir: img
- url: .*
script: main.app
libraries:
- name: webapp2
version: latest
- name: jinja2
version: latest所以在我的html页面中,我添加了
<img src='/img/find_person.png'>这张照片没有加载
有人能帮上忙吗?
发布于 2015-06-08 23:26:24
看起来你误解了静态目录处理程序的工作原理(你把事情倒过来了) url是项目的发布位置(即如何在html中引用它),而static_dir是它在应用程序目录层次结构中的实际存在位置。
从你的描述来看,这似乎就是你想要的:
- url: /img
static_dir: templates/control-panel/assets/imghttps://stackoverflow.com/questions/30692758
复制相似问题