Fixed #24143 -- Encouraged use of Http404 messages for debugging.

This commit is contained in:
Keryn Knight 2015-01-13 08:02:17 +00:00 committed by Tim Graham
parent a34fba5e59
commit 726a9550db
4 changed files with 10 additions and 5 deletions

View file

@ -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