Skip to content Skip to sidebar Skip to footer

Python App Engine : Use App.yaml To Control Url Handler

When I control different type of pages, I move my code to another python file. But this way has disadvantage : each time I want to change url hander, I must comback to main.py to c

Solution 1:

The /blog/.* url specification from the yaml file does not match the url specification from the blog.py file (/blog). In particular the fact that /blog/.* requires the url to have a slash after blog. If for example you use just /blog in both places it will work. Or you can use /blog/.* in both places.

The url specifiers are matched in the order in which they appear in the yaml file therefore in this particular case /blog/.* will not match on /blog but will match on the last (catch all really) /.* specifier and therefore main.py handler will be loaded and fail to match (no pattern in the call WSGIApplication constructor inside main.py).

Hope this helps. -Silviu

Post a Comment for "Python App Engine : Use App.yaml To Control Url Handler"