Improved error message for reverse v. reverse_lazy
|Reported by:||elena||Owned by:||bpeschier|
|Cc:||eromijn@…||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
ImproperlyConfigured: The included urlconf %s doesn't have any patterns in it.
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.
Suggestion: At least more specificity as to where the error lies.
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')
Change History (8)
comment:1 Changed 19 months ago by aaugustin
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Triage Stage changed from Unreviewed to Accepted
comment:2 Changed 17 months ago by carljm
- Component changed from Uncategorized to Core (URLs)
- Type changed from Uncategorized to Cleanup/optimization
comment:3 Changed 17 months ago by bpeschier
- Keywords nlsprint14 added
- Owner changed from nobody to bpeschier
- Status changed from new to assigned
comment:7 Changed 17 months ago by erikr
- Cc eromijn@… added
- Triage Stage changed from Accepted to Ready for checkin