2012-07-02 36 views
0

我一直在使用谷歌應用程序引擎來建立我的網站,並遇到了有關URLMap的最大數量(我有101個URL,但限制爲100)的問題。以下是錯誤消息:谷歌應用引擎100 URLMap條目限制

Fatal error when loading application configuration: 
Invalid object: 
Found more than 100 URLMap entries in application configuration 
    in "\AppPest\app.yaml", line 269, column 28 

我試圖更改文件appinfo.py設定MAX_URL_MAPS = 1000,但沒有奏效。任何人都可以給我一些建議嗎?

編輯:

另一個問題是,一些我的網址都差不多,像a_input.html,b_input.html,c_input.html。有沒有辦法簡化它以減少URL的數量?這裏是我的yaml文件的示例

#a 
- url: /a_input.html 
    script: a/a_input.py 

#b 
- url: /b_input.html 
    script: b/b_input.py 

#c 
- url: /c_input.html 
    script: c/c_input.py 

回答

2

解決方案將取決於您使用的語言。如果您正在使用python 2.7,你可以做的是:

1)使用正則表達式定義的網址,看到this doc更多細節

handlers: 
- url: /(.*?)_input.html 
    script: /input/\1.app 

點2)一組網址相同的應用程序,並讓應用程序處理不同的請求。

handlers: 
- url: /(.*?)_input.html 
    script: /input/input.app 

app = webapp2.WSGIApplication([('/a_input.html', AInputPage), ('/b_input.html', BInputPage)]) 

從信息提供你我不能告訴如果a_input.html,b_html是靜態或沒有。但如果它們是靜態的,你也可以這樣做:

3)將它們與static file handlers一起提交,它們也接受正則表達式。

- url: /input 
    static_dir: static/input 

issue 1444的一些細節,專爲Java相關的。

+0

感謝您與此幫助。我喜歡分組網址的方式,但對我的情況有可能(請參閱我的編輯)? –

+0

是的,您需要使用方法1),請參閱我指出的文檔。這裏是代碼(對不起,在註釋中沒有格式): - url:/(.*?)_input.html腳本:\ 1/\ 1_input.py。下次請指定您正在使用的運行時間。 –

+0

謝謝!這組方法起作用。我的運行時是python27。 –

0

我有使用Java SDK相同的問題。 我旋轉從welcome-file-list中刪除index.html。 現在我的入口點是index.jsp,重定向到我的index.html頁面。

在web.xml:

<welcome-file-list> 
    <welcome-file>index.jsp</welcome-file> 
</welcome-file-list> 

在AppEngine上-web.xml中:

<static-files> 
    <include path="/fonts/**" /> 
    <include path="/app/fonts/**" /> 
    <include path="/**.html" /> 
    <include path="/**.js" /> 
    <include path="/**.css" /> 
    <include path="/**.ico" /> 
    <include path="/**.png" /> 
    <include path="/**.jpg" /> 
    <include path="/**.jpeg" /> 
    <include path="/**.gif" /> 
</static-files>