谷歌应用引擎静态文件获得404

2024-04-29 20:03:38 发布

您现在位置:Python中文网/ 问答频道 /正文

下面的app.yaml在我的本地开发服务器上运行得很好。。但当我将它部署到生产环境中时,所有静态文件都抛出404。服务器找不到任何静态文件。已搜索数小时,找不到有效的解决方案。

注意:我是用mac开发的,所以知道系统的大小写敏感特性。

application: dev-scanner
version: 1
runtime: python
api_version: 1

handlers:
- url: /(.+)
  static_files: static_files/\1
  upload: ./static_files/(.+)

- url: /
  static_files: static_files/index.html
  upload: ./static_files/index.html

这是日志中的错误

2011-03-18 01:18:07.033 / 404 21ms 0cpu_ms 0kb Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_6; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.134 Safari/534.16,gzip(gfe),gzip(gfe),gzip(gfe) 76.126.174.202 - - [18/Mar/2011:01:18:07 -0700] "GET / HTTP/1.1" 404 0 - "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_6; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.134 Safari/534.16,gzip(gfe),gzip(gfe),gzip(gfe)" "dev.app-scanner.com" ms=21 cpu_ms=0 api_cpu_ms=0 cpm_usd=0.000053 W 2011-03-18 01:18:07.012 Static file referenced by handler not found: static_files/index.html

这是我使用appcfg.py download_app -A之后的文件系统结构

enter image description here


Tags: 文件dev服务器apiappindexversionhtml