在Google App Engine(Python)中上传静态图像

时间:2014-05-01 08:29:15

标签: python google-app-engine

我试图将JPEG图片上传到我的Google App Engine网站;然后,这些图像将在我的网站的HTML页面中引用。 我已将我的图像放在我的GAE项目根目录中的目录/ img中,并根据官方文档(https://developers.google.com/appengine/docs/python/gettingstartedpython27/staticfiles)由app.yaml文件进行配置,如下所示:

handlers:
- url: /img
  static_dir: img

- url: /javascript
  static_dir: javascript

- url: /.*
  script: main.application

但是,每当我尝试访问mywebsite.appspot.com/img/testImg.jpg上的图像时,我都会收到404无法加载资源错误 - 即使我的/ img中有testImg.jpg文件目录。 我在我的/ img目录中放置了一个虚拟文本文件,并且可以成功检索并显示mywebsite.appspot.com/img/test.txt,因此我不确定为什么我的图像会上传。我已多次查看Google App Engine指南,但无法找到任何答案...我的app.yaml文件看起来与他们的示例完全相同。

0 个答案:

没有答案