簡體   English   中英

app.yaml中的靜態目錄在目錄名稱中帶有空格,我該如何處理?

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

我有一個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引導程序(由其他人編寫)的項目,但是我不想返回他們的代碼並編輯所有href,是否有任何快速解決方案可以使這些嵌套的資源文件很好地與gae + app.yaml / webapp2?

多謝您的幫助!!

正確的配置是:

- 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