﻿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
24707	urls: error messages for broken views are better for deprecated-old-style than they are for new-style	Harry Percival	Harry Percival	"I found this out while updating my book to 1.8.  It's a tiny thing really, but if you've accidentally made an uncallable view function, eg:

{{{#!python
# views.py:
my_view = None
}}}

Contrast the behaviour of urls.py if you import it old-style and new-style:

{{{#!python
# urls.py:
from myapp import views
urlpatterns = [
    url(r'/new-style-url', views.my_view)
    url(r'/old-style-url', 'my_app.views.my_view')
]
}}}



Attempting to use the dot-notation gives a helpful error message:

{{{#!python
>>> resolve('/old-style-url')
[...]
ViewDoesNotExst: Could not import 'my_app.views.my_view'. View is not callable.""
}}}

But the new-style one is rather cryptic:

Attempting to 
{{{#!python
>>> resolve('/whatever')
[...]
AttributeError: 'NoneType' object has no attribute 'rindex'
}}}

It's a shame the deprecated, old-style version has better UX than the new-style!   I think it's a simple fix tho, I am working on a PR.
"	Cleanup/optimization	closed	Core (URLs)	dev	Normal	fixed			Ready for checkin	1	0	0	0	0	0
