O'Reilly logo

Django 1.1 Testing and Debugging by Karen M. Tracey

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Debug error pages

With DEBUG on, Django generates fancy debug error pages in two circumstances:

  • When a django.http.Http404 exception is raised
  • When any other exception is raised and not handled by the regular view processing code

In the latter case, the debug page contains a tremendous amount of information about the error, the request that caused it, and the environment at the time it occurred. Deciphering this page and making best use of the information it presents will be covered in the next chapter. The debug pages for Http404 exceptions are considerably simpler and will be covered here.

To see examples of the Http404 debug pages, consider the survey_detail view from Chapter 4:

def survey_detail(request, pk): survey = get_object_or_404(Survey, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required