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

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

2 participants

@zart

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
Pylons Project member
  • 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

@mcdonc
Pylons Project member

Thanks, I changed it to use script_name unconditionally!

@jdnavarro jdnavarro pushed a commit that referenced this issue Apr 23, 2011
@mcdonc 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