简体   繁体   中英

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,

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"

how do i map it in my 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...? 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? 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?

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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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