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 only 
> controls which routes.py is used. 
> 
> The phrase " This is enabled by configuring routes_app in the base routes.py 
> to determine from an incoming URL the name of the application to be selected 
> ". Does imply a bit more than this. Pattern based routing is confusing enough 
> already.
> 
> Could you now explain the following.
> 
> If I have a URL
> 
> 127.0.0.1:8002/gallery
> 
> This selects my gallery app.
> 
> If in routes.py I put
> 
> routes_in = (('/gallery','/welcome'),)
> 
> It does now route
> 
> 127.0.0.1:8002/gallery to the welcome app.
> 
> However if I change the routes_in to
> 
> routes_in = (('2/gallery','2/welcome'),)
> 
> it no longer routes
> 
> 127.0.0.1:8002/gallery to the welcome app, but leaves it as the gallery app, 
> so routes_in is no longer working.
> 
> Why is this?
> 

If you're trying to match the 2 from the port number, that's not going to work. 
The incoming URL isn't presented as a single string, but is instead broken up 
into components. I don't have the syntax at hand, but if you review the docs 
with that in mind you'll probably figure it out. Or someone else will chime in 
with the right pattern.

-- 



Reply via email to