[web2py] Re: After modifying routes.py, GAE still routing to Welcome rather than my app
Ok, today I finally solved this problem. the "default_application" in routes.py is case-sensitive. I named my application folder in a upper case and caused "missing" of default app then web2py goes for "welcome". 在 2011年11月6日星期日UTC+8下午9时28分27秒,Spring写道: > > Hi there, > > I'm facing a problem with GAE deployment. GAE still routes to Welcome > rather than my app when hitting www.myapp.com. And because I skipped > the Welcome app in app.yaml, it gives "invalid request". Tried > manually to go to "www.myapp.com/myapp/default/index", still "invalid > request". Things seem to be fine when running the app locally with > both web2py and GAE launcher. I even tried to give a new version > number and re-deploy, but the same happened. > > Contents of routes.py modified as follows: > > default_application = 'go2chongqing'# ordinarily set in base > routes.py > default_controller = 'default' # ordinarily set in app-specific > routes.py > default_function = 'index' # ordinarily set in app-specific > routes.py > > routes_app = ((r'/(?Pgo2chongqing|welcome|admin|app)\b.*', > r'\g'), > (r'(.*)', r'go2chongqing'), > (r'/?(.*)', r'go2chongqing')) > > routes_in and routes_out remain unchanged. > = > Can anybody help on this. Thanks in advance. > > Spring -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] Re: After modifying routes.py, GAE still routing to Welcome rather than my app
On Nov 6, 2011, at 10:44 PM, Spring wrote: > Hi Jonathan, > > I checked the debug logs on GAE as you suggested, and here is the > detail after I hit "www.mydomain.com": > > 2011-11-06 22:35:29.090 /favicon.ico 404 22ms 0cpu_ms 0kb > W 2011-11-06 22:35:29.090 Static file referenced by handler not found: > applications/go2chongqing/static/favicon.ico > 2011-11-06 22:35:28.674 /welcome/default/index 404 34ms 46cpu_ms 0kb > Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.2 (KHTML, like Gecko) > Chrome/15.0.874.106 Safari/535.2 > D 2011-11-06 22:35:28.667 routes_app: [182.54.127.197:http:// > www.go2chongqing.com:get /welcome/default/index] [go2chongqing] -> > go2chongqing So routes_app is working. But it's not important unless you have app-specific routers, which you don't. > D 2011-11-06 22:35:28.667 select routing parameters: BASE > D 2011-11-06 22:35:28.667 routes_in: [182.54.127.197:http:// > www.go2chongqing.com:get /welcome/default/index] -> /welcome/default/ > index (not rewritten) This is the interesting line. It says that the *incoming* URL (before routing) is http://www.go2chongqing.com:/welcome/default/index, which is why it's resolving to the welcome app. > I 2011-11-06 22:35:28.671 Saved; key: __appstats__:028600, part: 39 > bytes, full: 1488 bytes, overhead: 0.000 + 0.003; link: > http://www.go2chongqing.com/_ah/stats/details?time=1 > = > Base routes.py: > default_application = 'init'# ordinarily set in base routes.py > default_controller = 'default' # ordinarily set in app-specific > routes.py > default_function = 'index' # ordinarily set in app-specific > routes.py > > routes_app = ((r'/(?Pgo2chongqing)\b.*', r'\g'), > (r'(.*)', r'go2chongqing'), > (r'/?(.*)', r'go2chongqing')) > routes_in = ((r'.*:/favicon.ico', r'/examples/static/favicon.ico'), > (r'.*:/robots.txt', r'/examples/static/robots.txt'), > ((r'.*http://otherdomain.com.* (?P.*)', r'/app/ctr > \g'))) > routes_out = ((r'.*http://otherdomain.com.* /app/ctr(?P.*)', > r'\g'), > (r'/app(?P.*)', r'\g')) > == > routes.py under application/myapp/: > > default_application = 'go2chongqing'# ordinarily set in base > routes.py > default_controller = 'default' # ordinarily set in app-specific > routes.py > default_function = 'index' # ordinarily set in app-specific > routes.py > > routes_app = ((r'/(?Pgo2chongqing)\b.*', r'\g'), > (r'(.*)', r'go2chongqing'), > (r'/?(.*)', r'go2chongqing')) > > routes_in = ((r'/static/(?P[\w./-]+)', r'/go2chongqing/static/ > \g')) > routes_in = ((r'.*:/favicon.ico', r'/go2chongqing/static/ > favicon.ico'), > (r'.*:/robots.txt', r'/go2chongqing/static/robots.txt'), > ((r'.*http://go2chongqing.com.* (?P.*)', r'/app/ctr > \g'))) > routes_out = ((r'.*http://go2chongqing.com.* /app/ctr(?P.*)', > r'\g'), > (r'/app(?P.*)', r'\g')) > == > > The only "welcome" I can find out in both routes.py is udner > __routes_doctest(). Have no idea how GEA redirects to welcome/default/ > index. > > Spring > > > > On 11月6日, 下午11时26分, Jonathan Lundell wrote: >> On Nov 6, 2011, at 5:28 AM, Spring wrote: >> >> >> >> >> >>> I'm facing a problem with GAE deployment. GAE still routes to Welcome >>> rather than my app when hittingwww.myapp.com. And because I skipped >>> the Welcome app in app.yaml, it gives "invalid request". Tried >>> manually to go to "www.myapp.com/myapp/default/index", still "invalid >>> request". Things seem to be fine when running the app locally with >>> both web2py and GAE launcher. I even tried to give a new version >>> number and re-deploy, but the same happened. >> >>> Contents of routes.py modified as follows: >> >>> default_application = 'go2chongqing'# ordinarily set in base >>> routes.py >>> default_controller = 'default' # ordinarily set in app-specific >>> routes.py >>> default_function = 'index' # ordinarily set in app-specific >>> routes.py >> >>> routes_app = ((r'/(?Pgo2chongqing|welcome|admin|app)\b.*', >>> r'\g'), >>> (r'(.*)', r'go2chongqing'), >>> (r'/?(.*)', r'go2chongqing')) >> >>> routes_in and routes_out remain unchanged. >>> = >>> Can anybody help on this. Thanks in advance. >> >> Do you see anything routing-related in the GAE logs? You'll need to set the >> log viewing level to DEBUG.- 隐藏被引用文字 - >> >> - 显示引用的文字 -
[web2py] Re: After modifying routes.py, GAE still routing to Welcome rather than my app
Hi Jonathan, I checked the debug logs on GAE as you suggested, and here is the detail after I hit "www.mydomain.com": 2011-11-06 22:35:29.090 /favicon.ico 404 22ms 0cpu_ms 0kb W 2011-11-06 22:35:29.090 Static file referenced by handler not found: applications/go2chongqing/static/favicon.ico 2011-11-06 22:35:28.674 /welcome/default/index 404 34ms 46cpu_ms 0kb Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.106 Safari/535.2 D 2011-11-06 22:35:28.667 routes_app: [182.54.127.197:http:// www.go2chongqing.com:get /welcome/default/index] [go2chongqing] -> go2chongqing D 2011-11-06 22:35:28.667 select routing parameters: BASE D 2011-11-06 22:35:28.667 routes_in: [182.54.127.197:http:// www.go2chongqing.com:get /welcome/default/index] -> /welcome/default/ index (not rewritten) I 2011-11-06 22:35:28.671 Saved; key: __appstats__:028600, part: 39 bytes, full: 1488 bytes, overhead: 0.000 + 0.003; link: http://www.go2chongqing.com/_ah/stats/details?time=1 = Base routes.py: default_application = 'init'# ordinarily set in base routes.py default_controller = 'default' # ordinarily set in app-specific routes.py default_function = 'index' # ordinarily set in app-specific routes.py routes_app = ((r'/(?Pgo2chongqing)\b.*', r'\g'), (r'(.*)', r'go2chongqing'), (r'/?(.*)', r'go2chongqing')) routes_in = ((r'.*:/favicon.ico', r'/examples/static/favicon.ico'), (r'.*:/robots.txt', r'/examples/static/robots.txt'), ((r'.*http://otherdomain.com.* (?P.*)', r'/app/ctr \g'))) routes_out = ((r'.*http://otherdomain.com.* /app/ctr(?P.*)', r'\g'), (r'/app(?P.*)', r'\g')) == routes.py under application/myapp/: default_application = 'go2chongqing'# ordinarily set in base routes.py default_controller = 'default' # ordinarily set in app-specific routes.py default_function = 'index' # ordinarily set in app-specific routes.py routes_app = ((r'/(?Pgo2chongqing)\b.*', r'\g'), (r'(.*)', r'go2chongqing'), (r'/?(.*)', r'go2chongqing')) routes_in = ((r'/static/(?P[\w./-]+)', r'/go2chongqing/static/ \g')) routes_in = ((r'.*:/favicon.ico', r'/go2chongqing/static/ favicon.ico'), (r'.*:/robots.txt', r'/go2chongqing/static/robots.txt'), ((r'.*http://go2chongqing.com.* (?P.*)', r'/app/ctr \g'))) routes_out = ((r'.*http://go2chongqing.com.* /app/ctr(?P.*)', r'\g'), (r'/app(?P.*)', r'\g')) == The only "welcome" I can find out in both routes.py is udner __routes_doctest(). Have no idea how GEA redirects to welcome/default/ index. Spring On 11月6日, 下午11时26分, Jonathan Lundell wrote: > On Nov 6, 2011, at 5:28 AM, Spring wrote: > > > > > > > I'm facing a problem with GAE deployment. GAE still routes to Welcome > > rather than my app when hittingwww.myapp.com. And because I skipped > > the Welcome app in app.yaml, it gives "invalid request". Tried > > manually to go to "www.myapp.com/myapp/default/index", still "invalid > > request". Things seem to be fine when running the app locally with > > both web2py and GAE launcher. I even tried to give a new version > > number and re-deploy, but the same happened. > > > Contents of routes.py modified as follows: > > > default_application = 'go2chongqing' # ordinarily set in base > > routes.py > > default_controller = 'default' # ordinarily set in app-specific > > routes.py > > default_function = 'index' # ordinarily set in app-specific > > routes.py > > > routes_app = ((r'/(?Pgo2chongqing|welcome|admin|app)\b.*', > > r'\g'), > > (r'(.*)', r'go2chongqing'), > > (r'/?(.*)', r'go2chongqing')) > > > routes_in and routes_out remain unchanged. > > = > > Can anybody help on this. Thanks in advance. > > Do you see anything routing-related in the GAE logs? You'll need to set the > log viewing level to DEBUG.- 隐藏被引用文字 - > > - 显示引用的文字 -