google app engine - Gae webapp2 routing problems. match the uris wrong -


I am facing difficulties with the gae webapp2 routing system.

On my way / I have the following:

  _route = [RedirectRoute ('/', 'home.HomeHandler', name = 'home', strict_slash = true) , RedirectRoute ('/ users / comments / new /', 'users',' redirects' ('/ users /'; usercoded & gt; ',' Users.UserSingleHandler ', name =' user-page ', strict_slash = True) .UserNewCommentHandler ', name =' new-comment ', strict_slash = true]]  

I have the problem that when' to call AGX '/ users / tips / new' ' If the handler gets a call then there is UserSingleHandler and I do not need it (UserNet Comm Nthendlr). Upon inspection of the code, I have found that the user code in UserSingleHandler is the ultimate '/ comments / new /' ... odd!

¿Am I doing wrong?

will collect all requests on '/ users /' such as 'root / users / *' You can fix your problem by changing the order:

_route = [RedirectRoute ('/', 'home.HomeHandler', name = 'home', strict_slash = true), redirect root ('/ User / comments / new /', 'Users.UserNewCommentHandler', name = 'new-comment', strict_slash = True) Redirect route ('/ user / & lt; usercode & gt;', 'users.UserSingleHandler' , Name = 'user-page', strict_slash = true),]

Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -