diff --git a/docs/forms.txt b/docs/forms.txt index d7d3dd7c5f..ba8b2e8b7d 100644 --- a/docs/forms.txt +++ b/docs/forms.txt @@ -65,9 +65,8 @@ Using the ``AddManipulator`` We'll start with the ``AddManipulator``. Here's a very simple view that takes POSTed data from the browser and creates a new ``Place`` object:: - from django.core.exceptions import Http404 from django.core.extensions import render_to_response - from django.http import HttpResponse, HttpResponseRedirect + from django.http import Http404, HttpResponse, HttpResponseRedirect from django.models.places import places from django.core import formfields diff --git a/docs/tutorial03.txt b/docs/tutorial03.txt index 58c5ece244..6317ce53d4 100644 --- a/docs/tutorial03.txt +++ b/docs/tutorial03.txt @@ -274,7 +274,7 @@ Raising 404 Now, let's tackle the poll detail view -- the page that displays the question for a given poll. Here's the view:: - from django.core.exceptions import Http404 + from django.http import Http404 def detail(request, poll_id): try: p = polls.get_object(pk=poll_id) @@ -282,7 +282,7 @@ for a given poll. Here's the view:: raise Http404 return render_to_response('polls/detail', {'poll': p}) -The new concept here: The view raises the ``django.core.exceptions.Http404`` +The new concept here: The view raises the ``django.http.Http404`` exception if a poll with the requested ID doesn't exist. A shortcut: get_object_or_404()