Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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

Closed
zart opened this Issue · 2 comments

2 participants

Konstantin Zemlyak Chris McDonough
Konstantin Zemlyak

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)

Chris McDonough
Owner
  • 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
    #135).

  • pyramid.testing.DummyRequest now has a script_name attribute (the
    empty string).

Closed by 0a0edfc

Chris McDonough
Owner

Thanks, I changed it to use script_name unconditionally!

Danny Navarro jdnavarro referenced this issue from a commit
Chris McDonough mcdonc - ``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
  #135).

- ``pyramid.testing.DummyRequest`` now has a ``script_name`` attribute (the
  empty string).

Closes #135
0a0edfc
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.