【问题标题】:Trouble locating static audio file on Google App Engine在 Google App Engine 上查找静态音频文件时遇到问题
【发布时间】:2011-05-09 15:39:16
【问题描述】:

我有一个项目目录和一个子目录设置如下:

/proj_dir

/proj_dir/音频

app.yaml:

handlers:
- url: /.*
  script: main.py

- url: /audio
  static_dir: audio

main.py 是一个简单的 Python 程序,在 GET 请求中,它也在 proj_dir 目录中输出“index.html”文件。 index.html 文件包含一些播放音频文件的 javascript 代码。

问题是 index.html 在本地运行时播放音频文件没有问题。但是,一旦部署,我在尝试检索音频时会收到 404:

INFO     2010-11-13 20:43:10,046 dev_appserver.py:3283] "GET /audio/bangagong.mp3 HTTP/1.1" 404 -

任何帮助表示赞赏。谢谢。

【问题讨论】:

    标签: google-app-engine static-files


    【解决方案1】:

    您需要更改 url 处理程序的顺序。 * 处理程序捕获所有内容。试试这个:

    handlers:
    - url: /audio
      static_dir: audio
    
    - url: /.*
      script: main.py
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-08-18
      • 2013-09-23
      • 2011-07-18
      • 1970-01-01
      • 1970-01-01
      • 2021-05-14
      • 2010-10-23
      相关资源
      最近更新 更多