开发者

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

开发者 https://www.devze.com 2022-12-28 07:45 出处:网络
like this: handlers: - url: /media static_dir: media - url:开发者_Go百科 /form;/items.html script: validate.py

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

精彩评论

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