﻿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
5140	url templatetag should raise exception on invalid path	oliver.andrich@…	Adrian Holovaty	"I just stumbled across the fact, that the '''url templatetag''' silently accepts any path to a view - no matter if it exists or not. In the module django.template.defaulttags I have seen, that after processing the templatetag an URLNode is generatet and afterwards rendered.
{{{
    def render(self, context):
        from django.core.urlresolvers import reverse, NoReverseMatch
        args = [arg.resolve(context) for arg in self.args]
        kwargs = dict([(smart_str(k,'ascii'), v.resolve(context)) for k, v in self.kwargs.items()])
        try:
            return reverse(self.view_name, args=args, kwargs=kwargs)
        except NoReverseMatch:
            try:
                project_name = settings.SETTINGS_MODULE.split('.')[0]
                return reverse(project_name + '.' + self.view_name, args=args, kwargs=kwargs)
            except NoReverseMatch:
                return ''
}}}
The last try-catch-block which catches the second NoReverseMatch exception is causing the troubles. At least in my eyes.[[BR]]
I would find it much more convenient if I actually get the exception when I cause such an error. This would have saved my some time today, as I created such an error during my Django studies."		closed	Template system	dev		worksforme	url templatetag		Design decision needed	1	0	0	0	0	0
