The way it works is Pylons looks for a matching file using the appName/public folder as the root using StaticURLParser middleware (ie: '/css/styles.css' maps to appName/public/css/styles.css), if it finds a matching file there, it serves that, if it doesn't, then it looks for a matching rule in routing.py to find the appropriate controller/action to fire.
So in the case of '/', StaticURLParser looks in 'appName/public' and finds 'index.html' there and serves it up, without ever looking at routing.py. In order for the map.connect line you provided to ever even be fired, you'd have to first remove or rename the index.html file in the public folder. This might be helpful to you for further details: http://pylonsbook.com/en/1.1/exploring-pylons.html#serving-a-pylons-application On Thu, Jan 13, 2011 at 5:26 AM, tibi3384 <[email protected]> wrote: > Hi, I recently started to work with Pylons and I'm a little confused > about the routing settings that Pylons use. As far as I read, in order > to serve a certain page as default(eg when accessing localhost:5000 ), > one must add a routing "rule" in appName/config/routing.py. The code > should look something like > "map.connect('/', controller='hello', action='index')". However, the > application I need to work on does not have this rule and yet when > accessing localhost:5000 I'm directed to a login page automatically. > So is there another way to achieve this? I'm really confused on how > the pages are served in the browser, as I am used to the "look for > index.php/asp/etc" rule that usually apply for most languages. If > someone would explain this to me I'd really appreciate it. Thanks a > lot. > > -- > You received this message because you are subscribed to the Google Groups > "pylons-discuss" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<pylons-discuss%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/pylons-discuss?hl=en. > > -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
