mirror of
https://github.com/django/django.git
synced 2025-10-22 00:02:23 +00:00
Fixed #24143 -- Encouraged use of Http404 messages for debugging.
This commit is contained in:
parent
a34fba5e59
commit
726a9550db
4 changed files with 10 additions and 5 deletions
|
@ -442,7 +442,7 @@ for a given poll. Here's the view:
|
|||
try:
|
||||
question = Question.objects.get(pk=question_id)
|
||||
except Question.DoesNotExist:
|
||||
raise Http404
|
||||
raise Http404("Question does not exist")
|
||||
return render(request, 'polls/detail.html', {'question': question})
|
||||
|
||||
The new concept here: The view raises the :exc:`~django.http.Http404` exception
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue