开发者

how to make multi url in a line of '- url:' ,on google-app-engine

like this:

handlers:
- url: /media
  static_dir: media

- url:开发者_Go百科 /form;/items.html
  script: validate.py

/form;/items.html

i want /form and /item.html use validate.py

thanks


URL patterns are regular expressions, so you can simply provide a regular expression that matches both:

- url: /(form|items\.html)
  script: validate.py

Alternately, you can use multiple handlers, as Adam suggests, or just make validate.html your catchall (with an expression of '.*').


List the handler twice in your app.yaml, e.g.:

handlers:
- url: /media
  static_dir: media

- url: /form\.html
  script: validate.py

- url: /items\.html
  script: validate.py

Link to documentation.

Also note that you need to escape a full-stop (.) with a backslash (\), since "URL and file path patterns use POSIX extended regular expression syntax...".

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜