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'/(?P<app>go2chongqing)\b.*', r'\g<app>'),
>              (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<any>.*)', r'/app/ctr
> \g<any>')))
> routes_out = ((r'.*http://otherdomain.com.* /app/ctr(?P<any>.*)',
> r'\g<any>'),
>              (r'/app(?P<any>.*)', r'\g<any>'))
> ======================================================
> 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'/(?P<app>go2chongqing)\b.*', r'\g<app>'),
>              (r'(.*)', r'go2chongqing'),
>              (r'/?(.*)', r'go2chongqing'))
> 
> routes_in = ((r'/static/(?P<file>[\w./-]+)', r'/go2chongqing/static/
> \g<file>'))
> routes_in = ((r'.*:/favicon.ico', r'/go2chongqing/static/
> favicon.ico'),
>             (r'.*:/robots.txt', r'/go2chongqing/static/robots.txt'),
>             ((r'.*http://go2chongqing.com.* (?P<any>.*)', r'/app/ctr
> \g<any>')))
> routes_out = ((r'.*http://go2chongqing.com.* /app/ctr(?P<any>.*)',
> r'\g<any>'),
>              (r'/app(?P<any>.*)', r'\g<any>'))
> ======================================
> 
> 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 <jlund...@pobox.com> 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'/(?P<app>go2chongqing|welcome|admin|app)\b.*',
>>> r'\g<app>'),
>>>              (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.- 隐藏被引用文字 -
>> 
>> - 显示引用的文字 -


Reply via email to