mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
[1.7.x] Fixed #24143 -- Encouraged use of Http404 messages for debugging.
Backport of 726a9550db from master
This commit is contained in:
@@ -441,7 +441,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
|
||||
|
||||
Reference in New Issue
Block a user