Re: [web2py] Re: routes.py and patterns with routes_app

2012-08-30 Thread peter
I got inside gluon. The conversion is done within regex_uri I have found that http://127.0.0.1:8002/gallery becomes 127.0.0.1:http://127.0.0.1:get /gallery just before the conversion http://localhost:8002/gallery becomes 127.0.0.1:http://localhost:get /gallery So Massimo was almost right the

Re: [web2py] Re: routes.py and patterns with routes_app

2012-08-30 Thread Jonathan Lundell
On 30 Aug 2012, at 1:59 AM, peter peterchutchin...@gmail.com wrote: I got inside gluon. The conversion is done within regex_uri I have found that http://127.0.0.1:8002/gallery becomes 127.0.0.1:http://127.0.0.1:get /gallery just before the conversion http://localhost:8002/gallery

Re: [web2py] Re: routes.py and patterns with routes_app

2012-08-30 Thread peter
Thanks Jonathan. I wish I had known about rewrite logging a couple of days ago. Could I suggest that mention is made of this in the section of the book on rewriting URLs. It could save people a lot of time. Could I also suggest that routes_app=[('.*://mydomain:\w* /$anything','myapp'), is

[web2py] Re: routes.py and patterns with routes_app

2012-08-29 Thread Anthony
routes_app is used to tell the routing system which applications have their own application specific routes.py (in the application folder rather than the web2py root folder). I think you want to use routes_in (probably with a matching routes_out) instead. See

[web2py] Re: routes.py and patterns with routes_app

2012-08-29 Thread peter
Okay, I get it now, routes_app does not select the application, only where to get the substitute routes.py. The book is right with hindsight, but did not lead me to the right understanding. Maybe it should be clearer that it only controls which routes.py is used. The phrase This is enabled

Re: [web2py] Re: routes.py and patterns with routes_app

2012-08-29 Thread Jonathan Lundell
On 29 Aug 2012, at 6:46 AM, peter peterchutchin...@gmail.com wrote: Okay, I get it now, routes_app does not select the application, only where to get the substitute routes.py. The book is right with hindsight, but did not lead me to the right understanding. Maybe it should be clearer that it

Re: [web2py] Re: routes.py and patterns with routes_app

2012-08-29 Thread peter
I do not know what docs you are talking about here Jonathan. If the book, then it is very brief on this matter. The example The general syntax for routes is more complex than the simple examples we have seen so far. Here is a more general and representative example: 1. 2. 3. 4. routes_in = (

Re: [web2py] Re: routes.py and patterns with routes_app

2012-08-29 Thread peter
I am not sure what docs you are referring to Jonathan. The book gives an example: The general syntax for routes is more complex than the simple examples we have seen so far. Here is a more general and representative example: 1. 2. 3. 4. routes_in = (

Re: [web2py] Re: routes.py and patterns with routes_app

2012-08-29 Thread Jonathan Lundell
On 29 Aug 2012, at 8:13 AM, peter peterchutchin...@gmail.com wrote: I am not sure what docs you are referring to Jonathan. The book gives an example: The general syntax for routes is more complex than the simple examples we have seen so far. Here is a more general and representative example:

Re: [web2py] Re: routes.py and patterns with routes_app

2012-08-29 Thread peter
I tried routes_in = ((r' .*://localhost:.*',r'/welcome'),) and routes_in = ((r' .*localhost.*',r'/welcome'),) neither match localhost urls so I am at a loss. I would like to know how to match localhost. In the short run I want to do domains={ 'ukjazz.net':'british_jazz',

Re: [web2py] Re: routes.py and patterns with routes_app

2012-08-29 Thread Massimo Di Pierro
Are you trying to match the remote address as localhost? The problem is that it depends on what you browser puts in there. You can try: routes_in = [('127\.0\.0\.1:http://.*?:(GET|POST) /$anything','/welcome')] On Wednesday, 29 August 2012 12:08:56 UTC-5, peter wrote: I tried routes_in

Re: [web2py] Re: routes.py and patterns with routes_app

2012-08-29 Thread Jonathan Lundell
On 29 Aug 2012, at 10:08 AM, peter peterchutchin...@gmail.com wrote: I tried routes_in = ((r' .*://localhost:.*',r'/welcome'),) and routes_in = ((r' .*localhost.*',r'/welcome'),) neither match localhost urls so I am at a loss. I would like to know how to match localhost. If

Re: [web2py] Re: routes.py and patterns with routes_app

2012-08-29 Thread peter
Thanks for the suggestion Massimo It did not match with localhost or 127.0.0.1 eg localhost:8002/gallery Peter On Wednesday, 29 August 2012 18:19:26 UTC+1, Massimo Di Pierro wrote: Are you trying to match the remote address as localhost? The problem is that it depends on what you browser