简体   繁体   English

app.yaml中的静态目录在目录名称中带有空格,我该如何处理?

[英]Static dir in app.yaml with space in dir name, how do I handle this?

I have a GAE + webapp2 app and i get this error for href line in my html, 我有一个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 -

(I have a bunch of them but..) (我有一堆,但是..)

The problem is my html is referencing to this folder for css/js "components copy_files" 问题是我的html引用了该文件夹的css / js“ components copy_files”

how do i map it in my app.yaml? 如何在我的app.yaml中映射它? I tried 我试过了

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

and

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

and

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

But I can't get my site to load its css/js...? 但是我无法让我的网站加载其CSS / JS ...? Thanks in advance for the help. 先谢谢您的帮助。

Also as a follow up question, if i'm porting html/css/js from a different hosting server and all the href links and dir are in place how do i get app.yaml/webapp2 to route to all those files.. do i have to declare every static dir in my app.yaml? 另外,作为后续问题,如果我要从其他托管服务器移植html / css / js,并且所有href链接和目录都已到位,我如何将app.yaml / webapp2路由到所有这些文件。我必须在我的app.yaml中声明每个静态目录? btw: i'm porting a proj that uses twitter bootstrap (written by someone else) but i don't want to go back thru their code and edit all the hrefs, is there any quick solution to have these nested resource files play nicely with gae+app.yaml/webapp2? 顺便说一句:我正在移植一个使用Twitter引导程序(由其他人编写)的项目,但是我不想返回他们的代码并编辑所有href,是否有任何快速解决方案可以使这些嵌套的资源文件很好地与gae + app.yaml / webapp2?

Thanks a ton if you can help!! 多谢您的帮助!!

The right configuration it's: 正确的配置是:

- url: /components%20copy_files
  static_dir: templates/components copy_files
- url: /components%20copy_files
  static_dir: you can have whatever name you want here(doesn't have to match the url)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM