Skip to content
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.url.route_path() generates wrong relative URLs #135

Closed
zart opened this issue Feb 24, 2011 · 2 comments
Closed

pyramid.url.route_path() generates wrong relative URLs #135

zart opened this issue Feb 24, 2011 · 2 comments

Comments

@zart
Copy link

zart commented Feb 24, 2011

When pyramid application isn't mounted under web root route_path() generates wrong urls. They're actually absolute ones but don't take application's mount point into account.

There are a couple ways to fix this. Quick and easy one would be kw['_app_url'] = request.script_name. Another way to go is to generate non-absolute url relative to current request (ie ../../some/route)

@mcdonc
Copy link
Member

mcdonc commented Feb 25, 2011

  • pyramid.url.route_path (and the shortcut
    pyramid.request.Request.route_url method) now include the WSGI
    SCRIPT_NAME at the front of the path if it is not empty (see
    pyramid.url.route_path() generates wrong relative URLs #135).
  • pyramid.testing.DummyRequest now has a script_name attribute (the
    empty string).

Closed by 0a0edfc

@mcdonc
Copy link
Member

mcdonc commented Feb 25, 2011

Thanks, I changed it to use script_name unconditionally!

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants