-
Notifications
You must be signed in to change notification settings - Fork 886
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pyramid.config.Configurator.include() ignores route_prefix argument #628
Comments
Could you provide an example of this not working? This code here works just fine:
|
Oh, I think I see what you want, which is: route_prefix='/.' which comes up with: /.sontek/ for instance. Thats not going to work, route_prefix appends a '/' at the end of the prefix. so the route would be /./sontek |
See #406 |
@sontek exactly. But, there's no a standard which would require us to use a forward slash each time we'd like to display some sort of hierarchy in URL. Prefixes are not supposed to be treated as a "filesystem-like root tree path". They should be just "prefixes" - i.e. char sequences that are prepended to the route paths. |
You may wish it to not be true, but paths are what they are. That's unlikely to change in any "minor" release of Pyramid (any 1.X version). We might revisit it for a major version bump. |
@mcdonc ok, I'm down with it. I just wanted to point out, that Web standards operate with concepts of "resources" and "resource urls", not paths. The whole story of "paths" is based on ability of web servers to transparently map a resource url right onto host's filesystem object. But it's a feature, not a standard. Therefore, IMO, it would be wise to have two different features in further pyramid releases: a route-prefix-as-path-prefix feature, and a route-prefix-as-just-a-prefix feature. |
OK, well this issue is linked from #406 now, and it's got more details, so I'm going to close this one for now. We may revisit how route prefixing works in a new major release. |
Suppose I want to make a route to a user's profile page. Current implementation of route_prefix is very limited:
it doesn't allow me to bind my profile page at /. (dot separates profile pages from other "system" pages).
For example
will be generating URLs like /{userlogin} (without preceding dot).
it adds unnecessary slash after a dash prefix. For example
will be generating URLs like /-/{userlogin} which is incorrect prefix.
On the other hand, If I specify explicit prefixes to all of my add_route() calls
the system generates URLs that I expect to see. Therefore the current behaviour of route_prefix should be treated as a bug.
Note, that the Pylons' equvalent code based on Routes' submapper copes with these cases.
The text was updated successfully, but these errors were encountered: