﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
8051	urlresolvers.reverse assumes that top-level URL mappings are not empty	Dan Crosta	nobody	"If I want to map a certain application's URLs as the default handler, with a urlconf like so:

{{{
urlpatterns = patterns('',
    (r'', include('my.app.urls'),
)
}}}

with `my/app/urls.py` having:

{{{
urlpatterns = patterns('my.app.views',
    (r'(?P<full_url>.*)', 'show_page'),
)
}}}

Then when I use the `{% url ... %}` template tag, I get wrong URLs. If I write:

{{{
<a href=""{% url my.app.views.show_page another_page.full_url %}"">{{another_page.title}}</a>
}}}

I expect to get:

{{{
<a href=""/full_url_to_another_page"">Another Page</a>
}}}

But instead get:

{{{
<a href=""'''//'''full_url_to_another_page"">Another Page</a>
}}}

Those two leading slashes break the link -- Firefox 3 at least is interpereting it as a fully-qualified URL (with an implicit ""http:"" in the front, I guess?)

I tracked this down to [browser:django/trunk/django/core/urlresolvers.py@8015#L315 urlresolvers.py line 315] which adds a ""/"" to the prefix, even if the prefix is explicitly set to None or the empty string. I would add a patch, except I don't know Django core well enough to even hypothesize what it would look like."		closed	Uncategorized	dev		invalid			Unreviewed	0	0	0	0	0	0
