I am constructing a table of routes in my Pylons app. I can't get redirect() to work the way that it should work. I'm not sure what I'm doing wrong.
Here is an example of redirect() usage from the Routes documentation:
map.redirect("/home/index", "/", _redirect_code="301 Moved Permanently")
Here is what appears in my routing.py file:
map.redirect("/view", "/", _redirect_code="301 Moved Permanently")
Here is a route using redirect() that appears at the end of my routing.py file:
map.redirect('/*(url)/', '/{url}', _redirect_code="301 Moved Permanently")
This route works just fine, so I know that redirect() is present and functional. Therefore, I am doing something wrong in the /view redirect. I know this because when I point my browser at /view, I get the 404 page instead of getting redirected. Going to / works just fine, so I don't think that the problem is there, either. I think that redirect() in Routes is a great idea and I would like to be able to use it as intended, but I'm not sure what I'm doing wrong here.
ETA @jasonjs: I believe that no other route matches. When I try to access /view and then look at Paster's output, here's what I get:
21:22:26,276 DEBUG [routes.middleware] No route matched for GET /view
which seems pretty conclusive to me. I should mention that there is a route that matches POST requests to /view:
map.connect('/view', controller='view', action='search', conditions=dict(method=['POST'])
That route also works correctly, and I have it listed earlier in routing.py so that it tries to match that before it tries to match the /view[GET] route.