Code

Opened 3 years ago

Closed 3 years ago

#14621 closed (duplicate)

Non-informative error when URL is not properly configured

Reported by: srulix Owned by: nobody
Component: Uncategorized Version: 1.2
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

New into Django, I just stumbled across this when I was trying to do the Tutorial (which is great, by the way).

When the patterns are not properly configured in urls.py, for instance in this case:

urlpatterns = patterns('', # notice that i forgot to do 'polls.views' here
    (r'^$', 'index'),
    (r'^(?P<poll_id>\d+)/$', 'detail'),
    (r'^(?P<poll_id>\d+)/results/$', 'results'),
    (r'^(?P<poll_id>\d+)/vote/$', 'vote'),
)

The error just says 'str' object is not callable (I'm attaching full HTML). Digging further down I saw in Local args that callback = detail, and that raised the suspicion and I found it.

I think a more meaningful error, saying that the URL was matched to callback 'detail' and the corresponding view could not be found, would be nice.

Attachments (1)

TypeError at _polls_5_.htm (51.4 KB) - added by srulix 3 years ago.
the error

Download all attachments as: .zip

Change History (2)

Changed 3 years ago by srulix

the error

comment:1 Changed 3 years ago by srulix

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to duplicate
  • Status changed from new to closed

doh! this is a dupe to ticket:6442. sorry guys.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.