Opened 17 years ago
Closed 16 years ago
#6192 closed (worksforme)
url or reverse raise ViewDoesNotExists but fail to properly identify which view
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Core (Other) | Version: | dev |
Severity: | Keywords: | exception, ViewDoesNotExists, url | |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Got an unexpected error while was working with admin part.
On first call to '/admin', Django was displaying ViewDoesNotExists exception with reference to view that was included in my project's urls. Although that view truly didn't yet existed (I just put a reference to nonexistent view in order to write it later), it hadn't any relation to admin
app.
The source of error was admin's template system. Especially the 'base.html', at that line:
{% url django.contrib.admin.views.doc.doc_index %}
That were strange. It took a while for me to find the reason.
I believe this is because of the way url
template tag works.
It seems like it looks up in all available urls and views to calculate corresponding URL. And falls on nonexistent views.
This behaviour should be documented or (better) special exception should be raised in such case.
Change History (3)
comment:1 by , 17 years ago
Component: | Admin interface → Core framework |
---|---|
Summary: | Admin raises ViewDoesNotExists without an (obvious) reason → url or reverse raise ViewDoesNotExists but fail to properly identify which view |
comment:2 by , 16 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:3 by , 16 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
#6568 was complaining about a similar issue and I've been bitten by this one quite a few times. It's not really an admin issue but has to do with url/reverse.