Uninformative foremost as '''%s''' is top-level urls (problem usually in
included urls).
Caused by using '''reverse''' rather than '''reverse_lazy''' in some view.
No feedback whatsoever is given as to:
- that the error is caused in view rather than url
- which view this might be, or even which app it is in
'''Context:''' You get this error starting the developer server. The error
is cached (#11712) and fixing it doesn't make the error go away adding to
the confusion.[[BR]]
'''Suggestion:''' At least more specificity as to where the error lies.
Related tickets:
- https://code.djangoproject.com/ticket/17084
- https://code.djangoproject.com/ticket/15685
- https://code.djangoproject.com/ticket/11712
The above added here:
https://code.djangoproject.com/wiki/BetterErrorMessages
Appears be reproducible by adding to any view:
{{{
from django.core.urlresolvers import reverse
class DetailView(generic.DetailView):
...
attr = reverse('anything')
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/21435>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* stage: Unreviewed => Accepted
* needs_tests: => 0
* needs_docs: => 0
Comment:
Indeed, we could provide an error message hinting at the most likely cause
— a circular import.
--
Ticket URL: <https://code.djangoproject.com/ticket/21435#comment:1>
* component: Uncategorized => Core (URLs)
* type: Uncategorized => Cleanup/optimization
--
Ticket URL: <https://code.djangoproject.com/ticket/21435#comment:2>
* keywords: => nlsprint14
* owner: nobody => bpeschier
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/21435#comment:3>
Comment (by bpeschier):
Tweaked the error message, PR on
https://github.com/django/django/pull/2343
--
Ticket URL: <https://code.djangoproject.com/ticket/21435#comment:4>
Comment (by bpeschier):
The error is tested in the test suite, so we'll need to update it.
--
Ticket URL: <https://code.djangoproject.com/ticket/21435#comment:5>
* has_patch: 0 => 1
Comment:
Updated the PR.
--
Ticket URL: <https://code.djangoproject.com/ticket/21435#comment:6>
* cc: eromijn@… (added)
* stage: Accepted => Ready for checkin
Comment:
This looks fine to me, and the tests succeed.
--
Ticket URL: <https://code.djangoproject.com/ticket/21435#comment:7>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"173aa5199737c60ab883a0469684e83c01604ce8"]:
{{{
#!CommitTicketReference repository=""
revision="173aa5199737c60ab883a0469684e83c01604ce8"
Fixed #21435 -- Improved error message when urlconf is empty.
The new error message now hints that the most likely issue
is a circular import.
Thanks to trac user elena for the report and to
bpeschier for the original patch.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/21435#comment:8>