Google应用引擎100个URLMap条目限制 [英] Google app engine 100 URLMap entries limitation

查看:88
本文介绍了Google应用引擎100个URLMap条目限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用谷歌应用程序引擎来构建我的网站,并遇到了有关URLMap的最大数量的问题(我有101个URL,但限制为100)。这是错误信息:

pre $ 加载应用程序配置时发生致命错误:
无效对象:
找到更多在\AppPest\app.yaml,第269行,第28列中的应用程序配置中有100个URLMap条目

我试图在文件appinfo.py中更改设置 MAX_URL_MAPS = 1000 ,但它不起作用。任何人都可以给我一些建议吗?

编辑:



另一个问题是,我的一些URL类似,比如a_input.html,b_input。 html,c_input.html。有没有办法简化它以减少URL的数量?这是我的yaml文件的示例

  #a 
- url:/a_input.html
脚本:a / a_input.py

#b
- url:/b_input.html
脚本:b / b_input.py

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


解决方案

解决方案将取决于您使用的语言。如果您使用的是Python 2.7,您可以做的是:使用正则表达式定义url,请参阅此文档了解更多详情

 处理程序:
- url:/(.*?)_input.html
脚本:/input/\1.app

2)将一组网址指向同一个应用程序,让应用程序处理不同的请求。

 处理程序:
- url:/(.*?)_input.html
脚本:/ input /input.app

应用程式= webapp2.WSGIApplication([( '/ a_input.html',AInputPage),( '/b_input.html',BInputPage)])

根据您提供的信息,我无法判断a_input.html,b_html是否是静态的。但如果它们是静态的,你也可以这样做:



3)请参阅静态文件处理程序,它也接受正则表达式。

   -  url:/ input 
static_dir:static / input

请参阅 issue 1444 了解更多详情,特别是与java相关的内容。


I have been using google app engine to build my website, and met a problem about the maximum number of URLMap (I had 101 URLs, but the limit is 100). Here is the error message:

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

I tried to change the setting MAX_URL_MAPS = 1000 in the file appinfo.py, but it did not work. Can anyone give me some suggestions?

EDIT:

Another question is that some of my URLs are similar, like a_input.html, b_input.html, c_input.html. Is there a way to simplify it in order to reduce the number of URLs? Here is an example of my yaml file

#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

解决方案

The solution will depend on the language you are using. If you are using python 2.7, what you can do is to:

1) Use regular expression for defining the urls, see this doc for more details

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

2) Point a group of urls to the same app and let the app handle the different requests.

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

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

From the information you provided I cant tell if a_input.html, b_html are static or not. But if they are static yo could also do:

3) Refer them with the static file handlers, which also accept regular expressions.

- url: /input
  static_dir: static/input

See issue 1444 for some more details, specially for java related ones.

这篇关于Google应用引擎100个URLMap条目限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆