我在将静态文件上传到我的应用引擎站点时遇到问题。我已经尝试了 yaml 文件中的所有各种选项组合,但没有成功。更奇怪的是,当我上传所有图像时,它们似乎都存在了几分钟然后消失了。我什至可以从日志中看到他们暂时在那里。在本地一切正常。
YAML 如下:
application: socialsamplrsite
version: 1
runtime: python27
api_version: 1
threadsafe: false
libraries:
- name: django
version: "1.3"
builtins:
- django_wsgi: on
handlers:
- url: /img
static_dir: img
- url: /css/bootstrap.min.css
static_files: css/bootstrap.min.css
upload: css/bootstrap.min.css
- url: /js
static_dir: js
- url: .*
script: django_bootstrap.py
提前感谢您的任何帮助。
这是图像确实存在时的日志条目:
2012-11-30 01:07:34.199 /img/Social-Sampler-Master-Logo-for-web.png 200 24ms 43kb Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.91 Safari/537.11
203.79.108.219 - - [29/Nov/2012:04:07:34 -0800] "GET /img/Social-Sampler-Master-Logo-for-web.png HTTP/1.1" 200 43692 "http://socialsamplrsite.appspot.com/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.91 Safari/537.11" "socialsamplrsite.appspot.com" ms=24 cpu_ms=0
然后不久之后:
2012-11-30 01:08:51.822 /img/Social-Sampler-Master-Logo-for-web.png 404 146ms 0kb Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.91 Safari/537.11
203.79.108.219 - - [29/Nov/2012:04:08:51 -0800] "GET /img/Social-Sampler-Master-Logo-for-web.png HTTP/1.1" 404 0 - "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.91 Safari/537.11" "socialsamplrsite.appspot.com" ms=147 cpu_ms=0
W 2012-11-30 01:08:51.820 找不到处理程序引用的静态文件:/img/Social-Sampler-Master-Logo-for-web.png