close
Skip to content

Use reverse so more redirects work when MapIt is mounted on a subpath#228

Merged
mhl merged 1 commit into
masterfrom
more-redirects-using-reverse
Apr 5, 2016
Merged

Use reverse so more redirects work when MapIt is mounted on a subpath#228
mhl merged 1 commit into
masterfrom
more-redirects-using-reverse

Conversation

@mhl
Copy link
Copy Markdown
Contributor

@mhl mhl commented Feb 23, 2016

If you've included MapIt in another Django project, e.g. with:

urlpatterns += patterns('',
    (r'^mapit/', include('mapit.urls')),
)

... then some of the views that returned a redirect to a URL
constructed with string formatting would redirect to a path
that didn't include the 'mapit/' prefix. If these paths are
constructed with reverse() instead, it works properly.

This also introduces some new URL pattern names, so the URL
patterns can be referred to more concisely.

@dracos
Copy link
Copy Markdown
Member

dracos commented Mar 1, 2016

👍

@dracos dracos added Reviewed and removed Reviewing labels Mar 1, 2016
If you've included MapIt in another Django project, e.g. with:

    urlpatterns += patterns('',
        (r'^mapit/', include('mapit.urls')),
    )

... then some of the views that returned a redirect to a URL
constructed with string formatting would redirect to a path
that didn't include the 'mapit/' prefix.  If these paths are
constructed with reverse() instead, it works properly.

This also introduces some new URL pattern names, so the URL
patterns can be referred to more concisely.
@mhl mhl force-pushed the more-redirects-using-reverse branch from 8a643aa to d692d27 Compare April 5, 2016 10:09
@mhl mhl merged commit d692d27 into master Apr 5, 2016
@dracos dracos removed the Reviewed label Apr 5, 2016
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

Successfully merging this pull request may close these issues.

2 participants