0

我有一个 GAE + webapp2 应用程序,我的 html 中的 href 行出现此错误,

INFO     2012-08-25 00:08:47,461 dev_appserver.py:2891] "GET /components%20copy_files/bootstrap-typeahead.js HTTP/1.1" 404 -
INFO     2012-08-25 00:08:47,470 dev_appserver.py:2891] "GET /components%20copy_files/application.js HTTP/1.1" 404 -

(我有一堆但是..)

问题是我的 html 引用了 css/js "components copy_files" 的这个文件夹

我如何在我的 app.yaml 中映射它?我试过了

- url: /components%20copy_files
    static_dir: templates/components%20copy_files

- url: /components copy_files
      static_dir: templates/components copy_files

- url: /components\%20copy_files
      static_dir: templates/components\%20copy_files

但我无法让我的网站加载它的 css/js ......?在此先感谢您的帮助。

同样作为后续问题,如果我从不同的托管服务器移植 html/css/js 并且所有 href 链接和目录都已到位,我如何让 app.yaml/webapp2 路由到所有这些文件.. 做我必须在我的 app.yaml 中声明每个静态目录?顺便说一句:我正在移植一个使用 twitter bootstrap(由其他人编写)的项目,但我不想通过他们的代码返回并编辑所有的 href,有没有什么快速的解决方案可以让这些嵌套的资源文件很好地播放gae+app.yaml/webapp2?

如果你能提供帮助,非常感谢!

4

2 回答 2

1
- url: /components%20copy_files
  static_dir: you can have whatever name you want here(doesn't have to match the url)
于 2012-08-25T02:21:19.653 回答
1

正确的配置是:

- url: /components%20copy_files
  static_dir: templates/components copy_files
于 2012-08-25T02:05:35.380 回答